### Question:
Domain { public abstract EntityCategory getCategory(Entity entity);  abstract List<EntityCategory> getCategories(); abstract ObservableList<? extends Entity> getCategoryContents(EntityCategory node); abstract EntityCategory getCategory(Entity entity); abstract EntityCategory getCategory(Class<? extends Entity> entityClass); abstract SortedSetModel<Drug> getDrugs(); abstract ObservableList<TreatmentCategorization> getTreatmentCategorizations(); abstract SortedSetModel<Indication> getIndications(); abstract SortedSetModel<Endpoint> getEndpoints(); abstract SortedSetModel<AdverseEvent> getAdverseEvents(); abstract SortedSetModel<PopulationCharacteristic> getPopulationCharacteristics(); abstract SortedSetModel<Study> getStudies(); abstract ObservableList<TreatmentCategorization> getCategorizations(final Drug drug); abstract SortedSetModel<MetaAnalysis> getMetaAnalyses(); abstract SortedSetModel<BenefitRiskAnalysis<?>> getBenefitRiskAnalyses(); abstract SortedSetModel<Unit> getUnits(); abstract void deleteEntity(Entity entity); abstract boolean hasDependents(Entity entity); abstract ObservableList<MetaAnalysis> getPairWiseMetaAnalyses(); abstract ObservableList<MetaAnalysis> getNetworkMetaAnalyses(); abstract ObservableList<Study> getStudies(Variable e); abstract ObservableList<Study> getStudies(Drug d); abstract ObservableList<Study> getStudies(Indication i); static final Unit GRAM; static final Unit LITER; }### Answer:
@Test public void testGetCategoryForClass() { assertEquals(Indication.class, d_domain.getCategory(Indication.class).getEntityClass()); assertEquals(null, d_domain.getCategory(Arm.class)); assertEquals(Drug.class, d_domain.getCategory(Drug.class).getEntityClass()); assertEquals(PairWiseMetaAnalysis.class, d_domain.getCategory(PairWiseMetaAnalysis.class).getEntityClass()); assertEquals(NetworkMetaAnalysis.class, d_domain.getCategory(NetworkMetaAnalysis.class).getEntityClass()); }
@Test public void testGetCategoryForEntity() { ExampleData.initDefaultData(d_domain); assertEquals(Indication.class, d_domain.getCategory(new Indication(13L, "indication")).getEntityClass()); assertEquals(null, d_domain.getCategory(new Arm("arm", 3))); assertEquals(Drug.class, d_domain.getCategory(new Drug("drug", "")).getEntityClass()); assertEquals(BenefitRiskAnalysis.class, d_domain.getCategory(ExampleData.buildMetaBenefitRiskAnalysis()).getEntityClass()); }