### Question:
TreatmentCategorization extends AbstractEntity implements Comparable<TreatmentCategorization>, TypeWithName { public void addCategory(final Category categoryNode) { d_categories.add(categoryNode); } private  TreatmentCategorization(final String name, final Drug drug, final DoseUnit unit, boolean withDefault); static TreatmentCategorization createBare(String name, Drug drug, DoseUnit unit); static TreatmentCategorization createDefault(String name, Drug drug, DoseUnit unit); static TreatmentCategorization createDefault(); static TreatmentCategorization createTrivial(Drug drug); boolean isTrivial(); @Override String getName(); void setName(final String name); Drug getDrug(); void setDrug(final Drug drug); DoseUnit getDoseUnit(); void addCategory(final Category categoryNode); ObservableList<Category> getCategories(); Category getCategory(final AbstractDose dose); @Override String getLabel(); @Override String toString(); @Override Set<? extends Entity> getDependencies(); DecisionTree getDecisionTree(); DecisionTreeNode getRootNode(); Pair<RangeEdge> splitRange(final ChoiceNode parent, final double value, final boolean lowerRangeOpen); Pair<RangeEdge> splitRange(final RangeEdge edge, final double value, final boolean lowerRangeOpen); @Override int compareTo(TreatmentCategorization o); @Override boolean equals(Object obj); @Override boolean deepEquals(Entity obj); @Override int hashCode(); static final ChoiceNode ROOT_NODE; static final String PROPERTY_DOSE_UNIT; static final String PROPERTY_DRUG; static final String PROPERTY_CATEGORIES; }### Answer:
@Test public void testAddCategory() { final Category category = new Category(d_treatment, "foo"); d_treatment.addCategory(category); assertEquals(Arrays.asList(category), d_treatment.getCategories()); }