@Test public void testBuildSubToParentEdOrgCache() { EntityToEdOrgCache cache = new EntityToEdOrgCache(); cache.addEntry("lea-1", "school-1"); cache.addEntry("lea-1", "school-2"); cache.addEntry("lea-1", "school-3"); cache.addEntry("lea-2", "school-4"); cache.addEntry("lea-2", "school-5"); cache.addEntry("lea-3", "school-6"); Map<String, Collection<String>> result = helper.buildSubToParentEdOrgCache(cache); Assert.assertEquals(6, result.keySet().size()); Assert.assertEquals(Sets.newHashSet("lea-1"), result.get("school-1")); Assert.assertEquals(Sets.newHashSet("lea-1"), result.get("school-2")); Assert.assertEquals(Sets.newHashSet("lea-1"), result.get("school-3")); Assert.assertEquals(Sets.newHashSet("lea-2"), result.get("school-4")); Assert.assertEquals(Sets.newHashSet("lea-2"), result.get("school-5")); Assert.assertEquals(Sets.newHashSet("lea-3"), result.get("school-6")); }
public Map<String, Collection<String>> buildSubToParentEdOrgCache(EntityToEdOrgCache edOrgCache) { Map<String, String> result = new HashMap<String, String>(); HashMultimap<String, String> map = HashMultimap.create(); for(String lea : edOrgCache.getEntityIds()) { for (String child : edOrgCache.getEntriesById(lea)) { result.put(child, lea); map.put(child, lea); } } return map.asMap(); }
ExtractorHelper { public Map<String, Collection<String>> buildSubToParentEdOrgCache(EntityToEdOrgCache edOrgCache) { Map<String, String> result = new HashMap<String, String>(); HashMultimap<String, String> map = HashMultimap.create(); for(String lea : edOrgCache.getEntityIds()) { for (String child : edOrgCache.getEntriesById(lea)) { result.put(child, lea); map.put(child, lea); } } return map.asMap(); } }
ExtractorHelper { public Map<String, Collection<String>> buildSubToParentEdOrgCache(EntityToEdOrgCache edOrgCache) { Map<String, String> result = new HashMap<String, String>(); HashMultimap<String, String> map = HashMultimap.create(); for(String lea : edOrgCache.getEntityIds()) { for (String child : edOrgCache.getEntriesById(lea)) { result.put(child, lea); map.put(child, lea); } } return map.asMap(); } ExtractorHelper();  ExtractorHelper(EdOrgExtractHelper edOrgExtractHelper); }
ExtractorHelper { public Map<String, Collection<String>> buildSubToParentEdOrgCache(EntityToEdOrgCache edOrgCache) { Map<String, String> result = new HashMap<String, String>(); HashMultimap<String, String> map = HashMultimap.create(); for(String lea : edOrgCache.getEntityIds()) { for (String child : edOrgCache.getEntriesById(lea)) { result.put(child, lea); map.put(child, lea); } } return map.asMap(); } ExtractorHelper();  ExtractorHelper(EdOrgExtractHelper edOrgExtractHelper); Map<String, DateTime> fetchAllEdOrgsForStudent(Entity student); Map<String, DateTime> updateEdorgToDateMap(Map<String, Object> entityBody, Map<String, DateTime> edOrgToDate,
                                                      String edOrgIdField, String beginDateField, String endDateField); void setDateHelper(DateHelper helper); Set<String> fetchCurrentParentsFromStudent(Entity student); Map<String, Collection<String>> buildSubToParentEdOrgCache(EntityToEdOrgCache edOrgCache); EdOrgExtractHelper getEdOrgExtractHelper(); void setEdOrgExtractHelper(EdOrgExtractHelper edOrgExtractHelper); }
ExtractorHelper { public Map<String, Collection<String>> buildSubToParentEdOrgCache(EntityToEdOrgCache edOrgCache) { Map<String, String> result = new HashMap<String, String>(); HashMultimap<String, String> map = HashMultimap.create(); for(String lea : edOrgCache.getEntityIds()) { for (String child : edOrgCache.getEntriesById(lea)) { result.put(child, lea); map.put(child, lea); } } return map.asMap(); } ExtractorHelper();  ExtractorHelper(EdOrgExtractHelper edOrgExtractHelper); Map<String, DateTime> fetchAllEdOrgsForStudent(Entity student); Map<String, DateTime> updateEdorgToDateMap(Map<String, Object> entityBody, Map<String, DateTime> edOrgToDate,
                                                      String edOrgIdField, String beginDateField, String endDateField); void setDateHelper(DateHelper helper); Set<String> fetchCurrentParentsFromStudent(Entity student); Map<String, Collection<String>> buildSubToParentEdOrgCache(EntityToEdOrgCache edOrgCache); EdOrgExtractHelper getEdOrgExtractHelper(); void setEdOrgExtractHelper(EdOrgExtractHelper edOrgExtractHelper);  }