### Question:
TreatmentCategorization extends AbstractEntity implements Comparable<TreatmentCategorization>, TypeWithName { public Pair<RangeEdge> splitRange(final ChoiceNode parent, final double value, final boolean lowerRangeOpen) { final RangeEdge edge = (RangeEdge) d_decisionTree.findMatchingEdge(parent, value); return splitRange(edge, value, lowerRangeOpen); } 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 testSplitRange() { final DecisionTree tree = d_treatment.getDecisionTree(); final ChoiceNode choice = new DoseQuantityChoiceNode(FixedDose.class, FixedDose.PROPERTY_QUANTITY, DoseUnit.createMilliGramsPerDay()); tree.replaceChild(tree.findMatchingEdge(tree.getRoot(), FixedDose.class), choice); final LeafNode child = new LeafNode(new Category(d_treatment, "Low Dose")); tree.addChild(new RangeEdge(0.0, false, Double.POSITIVE_INFINITY, false), choice, child); d_treatment.splitRange(choice, 20.0, false); assertNull(tree.decide(new FixedDose(30.0, DoseUnit.createMilliGramsPerDay())).getCategory()); assertEquals(child, tree.decide(new FixedDose(18.0, DoseUnit.createMilliGramsPerDay()))); assertEquals(child, tree.decide(new FixedDose(20.0, DoseUnit.createMilliGramsPerDay()))); d_treatment.splitRange(choice, 10.0, false); assertEquals(child, tree.decide(new FixedDose(10.0, DoseUnit.createMilliGramsPerDay()))); assertNull(tree.decide(new FixedDose(18.0, DoseUnit.createMilliGramsPerDay())).getCategory()); final DecisionTreeNode medium = new LeafNode(new Category(d_treatment, "Med Dose")); tree.replaceChild(tree.findMatchingEdge(choice, 18.0), medium); assertEquals(medium, tree.decide(new FixedDose(18.0, DoseUnit.createMilliGramsPerDay()))); }