### Question:
DisciplineActionContextResolver implements ContextResolver { @Override public Set<String> findGoverningEdOrgs(Entity entity) { Set<String> edOrgs = new HashSet<String>(); List<String> studentIds = (List<String>) entity.getBody().get(ParameterConstants.STUDENT_ID); for(String studentId: studentIds){ edOrgs.addAll(studentResolver.findGoverningEdOrgs(studentId, entity)); } return edOrgs; }  @Override Set<String> findGoverningEdOrgs(Entity entity);  }### Answer:
@Test public void testSingleStudent() { Entity disciplineAction = Mockito.mock(Entity.class); Map<String, Object> body = new HashMap<String, Object>(); body.put(ParameterConstants.STUDENT_ID, Arrays.asList("student1")); Mockito.when(disciplineAction.getBody()).thenReturn(body); Mockito.when(studentResolver.findGoverningEdOrgs("student1", disciplineAction)).thenReturn(new HashSet<String>(Arrays.asList("edOrg1"))); Assert.assertEquals(new HashSet<String>(Arrays.asList("edOrg1")), resolver.findGoverningEdOrgs(disciplineAction)); }
@Test public void testMultipleStudents() { Entity disciplineAction = Mockito.mock(Entity.class); Map<String, Object> body = new HashMap<String, Object>(); body.put(ParameterConstants.STUDENT_ID, Arrays.asList("student1", "student2", "student3", "student4")); Mockito.when(disciplineAction.getBody()).thenReturn(body); Mockito.when(studentResolver.findGoverningEdOrgs("student1", disciplineAction)).thenReturn(new HashSet<String>(Arrays.asList("edOrg1"))); Mockito.when(studentResolver.findGoverningEdOrgs("student2", disciplineAction)).thenReturn(new HashSet<String>(Arrays.asList("edOrg2", "edOrg1"))); Mockito.when(studentResolver.findGoverningEdOrgs("student3", disciplineAction)).thenReturn(new HashSet<String>(Arrays.asList("edOrg3","edOrg2", "edOrg1"))); Mockito.when(studentResolver.findGoverningEdOrgs("student4", disciplineAction)).thenReturn(new HashSet<String>(Arrays.asList("edOrg4"))); Assert.assertEquals(new HashSet<String>(Arrays.asList("edOrg1", "edOrg2", "edOrg3", "edOrg4")), resolver.findGoverningEdOrgs(disciplineAction)); }