### Question:
DecisionNode extends TreeNode { @Override public boolean equals(Object o) { if (!(o instanceof DecisionNode)) { return false; } DecisionNode other = (DecisionNode) o; return decision.equals(other.decision) && left.equals(other.left) && right.equals(other.right); } DecisionNode(String id, Decision decision, TreeNode left, TreeNode right); Decision getDecision(); @Override boolean isTerminal(); TreeNode getLeft(); TreeNode getRight(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testEquals() { Decision a = new NumericDecision(1, 2.0, true); Decision b = new NumericDecision(1, 2.0, true); Prediction p = new NumericPrediction(-1.0, 1); TreeNode left = new TerminalNode("2", p); TreeNode right = new TerminalNode("3", p); DecisionNode da = new DecisionNode("a", a, left, right); DecisionNode db = new DecisionNode("b", b, left, right); assertEquals(da, db); assertEquals(da.hashCode(), db.hashCode()); }