import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import java.util.Arrays; import java.util.Collections; import java.util.Map; public class SimpleTest { private final SchoolAssignmentSolver solver = new BBSchoolAssignmentSolver(); @Test public void testOneSchool() { School school = new School(0, 1); Student student = new Student(school); Map solution = solver.assign(Collections.singleton(school), Collections.singleton(student)); Assertions.assertEquals(school, solution.get(student)); } @Test public void testFitTwo() { School sc1 = new School(0, 2), sc2 = new School(1, 2); Student st1 = new Student(sc1, sc2), st2 = new Student(sc2, sc1); Map solution = solver.assign(Arrays.asList(sc1, sc2), Arrays.asList(st1, st2)); Assertions.assertEquals(sc1, solution.get(st1)); Assertions.assertEquals(sc2, solution.get(st2)); } }