### Question:
DecisionTree implements TreeBasedClassifier { public TreeNode findByID(String id) { TreeNode node = root; while (!id.equals(node.getID())) { if (node.isTerminal()) { throw new IllegalArgumentException("No node with ID " + id); } Preconditions.checkState(id.startsWith(node.getID()), "Node ID %s is not a prefix of %s", node.getID(), id); DecisionNode decisionNode = (DecisionNode) node; char decisionChar = id.charAt(node.getID().length()); Preconditions.checkState(decisionChar == '-' || decisionChar == '+'); if (decisionChar == '+') { node = decisionNode.getRight(); } else { node = decisionNode.getLeft(); } } return 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 testFindByID() { DecisionTree tree = buildTestTree(); TerminalNode node = (TerminalNode) tree.findByID("r-+"); assertEquals(1.0, ((NumericPrediction) node.getPrediction()).getPrediction()); }