### Question:
DomainImpl extends Domain { public Set<Entity> getDependents(Entity e) { Set<Entity> deps = new HashSet<Entity>(); for (Study s : getStudies().getSet()) { if (s.getDependencies().contains(e)) { deps.add(s); } } for (MetaAnalysis s : getMetaAnalyses().getSet()) { if (s.getDependencies().contains(e)) { deps.add(s); } } for (BenefitRiskAnalysis<?> s : getBenefitRiskAnalyses().getSet()) { if (s.getDependencies().contains(e)) { deps.add(s); } } return deps; } DomainImpl(); void addOutcomeMeasure(OutcomeMeasure om); ObservableList<Study> getStudies(Variable e); ObservableList<Study> getStudies(Drug d); ObservableList<Study> getStudies(Indication i); ObservableList<TreatmentCategorization> getCategorizations(final Drug drug); @Override boolean equals(Object o); @Override int hashCode(); Set<Entity> getDependents(Entity e); void deleteEntity(Entity entity); boolean hasDependents(Entity entity); List<EntityCategory> getCategories(); EntityCategory getCategory(Entity entity); EntityCategory getCategory(Class<? extends Entity> entityClass); @SuppressWarnings("unchecked") ObservableList<? extends Entity> getCategoryContents(EntityCategory node); @Override SortedSetModel<Drug> getDrugs(); @Override ObservableList<TreatmentCategorization> getTreatmentCategorizations(); @Override SortedSetModel<Indication> getIndications(); @Override SortedSetModel<AdverseEvent> getAdverseEvents(); @Override SortedSetModel<Endpoint> getEndpoints(); @Override SortedSetModel<PopulationCharacteristic> getPopulationCharacteristics(); @Override SortedSetModel<Study> getStudies(); @Override SortedSetModel<MetaAnalysis> getMetaAnalyses(); @Override ObservableList<MetaAnalysis> getPairWiseMetaAnalyses(); @Override ObservableList<MetaAnalysis> getNetworkMetaAnalyses(); @Override SortedSetModel<BenefitRiskAnalysis<?>> getBenefitRiskAnalyses(); @Override SortedSetModel<Unit> getUnits();  }### Answer:
@Test public void testGetDependents() { ExampleData.initDefaultData(d_domain); Indication ind = ExampleData.buildIndicationDepression(); List<Entity> entities = new ArrayList<Entity>(); entities.add(ExampleData.buildStudyChouinard()); entities.add(ExampleData.buildStudyDeWilde()); entities.add(ExampleData.buildStudyBennie()); entities.add(ExampleData.buildStudyMultipleArmsperDrug()); JUnitUtil.assertAllAndOnly(entities, d_domain.getDependents(ind)); Drug fluox = ExampleData.buildDrugFluoxetine(); JUnitUtil.assertAllAndOnly(new HashSet<Entity>(entities), d_domain.getDependents(fluox)); Study s = ExampleData.buildStudyChouinard(); assertEquals(Collections.emptySet(), d_domain.getDependents(s)); OutcomeMeasure d1 = ExampleData.buildEndpointHamd(); assertEquals(new HashSet<Entity>(entities), d_domain.getDependents(d1)); }