### Question:
DecisionTree implements TreeBasedClassifier { public TerminalNode findTerminal(Example example) { TreeNode node = root; while (!node.isTerminal()) { DecisionNode decisionNode = (DecisionNode) node; if (decisionNode.getDecision().isPositive(example)) { node = decisionNode.getRight(); } else { node = decisionNode.getLeft(); } } return (TerminalNode) node; } DecisionTree(TreeNode root); @Override Prediction predict(Example test); TerminalNode findTerminal(Example example); TreeNode findByID(String id); @Override void update(Example train); @Override String toString();  }### Answer:
@Test public void testFindTerminal() { DecisionTree tree = buildTestTree(); TerminalNode node = tree.findTerminal(new Example(null, NumericFeature.forValue(0.5))); NumericPrediction prediction = (NumericPrediction) node.getPrediction(); assertEquals(1.0, prediction.getPrediction()); }