### Question:
EdOrgHelper { public Set<String> getAllChildLEAsOfEdOrg(Entity edOrgEntity) { String myId; Set<String> edOrgs = new HashSet<String>(); Set<String> result = new HashSet<String>(); if (edOrgEntity == null || edOrgEntity.getEntityId() == null) { return null; } myId = edOrgEntity.getEntityId(); edOrgs.add(myId); result = getAllChildLEAsOfEdOrg(edOrgs, new HashSet<String>()); result.remove(myId); return result; }  @PostConstruct void init(); List<String> getDistricts(Entity user); List<String> getDistricts(Set<String> edOrgs); List<String> getDirectChildLEAsOfEdOrg(Entity edOrgEntity); Set<String> getAllChildLEAsOfEdOrg(Entity edOrgEntity); List<String> getParentEdOrgs(Entity edOrgEntity); Entity byId(String edOrgId); boolean isSEA(Entity entity); String getSEAOfEdOrg(Entity entity); List<String> getDirectSchools(Entity principal); List<String> getDirectSchoolsLineage(Entity principal, boolean getLineage); Set<String> getChildEdOrgs(Collection<String> edOrgs); Set<String> getChildEdOrgs(String edOrg); Set<String> getChildEdOrgs(final Set<String> visitedEdOrgs, Collection<String> edOrgs); Set<String> getChildEdOrgsName(Collection<String> parentEdOrgIds); Set<String> getChildEdOrgsName(Collection<String> parentEdOrgIds, boolean includeParents); Collection<String> getUserEdOrgs(Entity principal); Set<String> getStaffEdOrgsAndChildren(); Set<String> getEdorgDescendents(Set<String> edOrgLineage); Set<String> getDelegatedEdorgDescendents(); boolean isFieldExpired(Map<String, Object> body, String fieldName, boolean useGracePeriod); @SuppressWarnings("unchecked") boolean isLEA(Entity entity); @SuppressWarnings("unchecked") boolean isSchool(Entity entity); Set<String> getDirectEdorgs(); Set<String> getDirectEdorgs(Entity principal); List<String> getUserEdorgs(Entity principal); Set<String> locateDirectEdorgs(Entity principal); Set<Entity> locateValidSEOAs(String staffId, boolean filterByOwnership); Set<Entity> locateNonExpiredSEOAs(String staffId); Set<String> getEdOrgStateOrganizationIds(Set<String> edOrgIds);  }### Answer:
@Test public void testGetAllChildLeaOfEdorgs() { Set<String> edorgs = helper.getAllChildLEAsOfEdOrg(sea1); assertEquals(4, edorgs.size()); assertTrue("lea1 should be a child of sea1", edorgs.contains(lea1.getEntityId())); assertTrue("lea2 should be a child of sea1", edorgs.contains(lea2.getEntityId())); assertTrue("lea3 should be a child of sea1", edorgs.contains(lea3.getEntityId())); assertTrue("lea4 should be a child of sea1", edorgs.contains(lea4.getEntityId())); }
@Test public void testGetAllChildLeaOfEdorgsWithCycle() { Set<String> edorgs = helper.getAllChildLEAsOfEdOrg(leaCycle1); assertEquals(2, edorgs.size()); assertFalse("leaCycle1 should not be a child of leaCycle1", edorgs.contains(leaCycle1.getEntityId())); assertTrue("leaCycle2 should be a child of leaCycle1", edorgs.contains(leaCycle2.getEntityId())); assertTrue("leaCycle3 should be a child of leaCycle1", edorgs.contains(leaCycle3.getEntityId())); }