### Question:
Node implements Comparable<Node> { @Override public String toString() { return new StringBuilder(MIN_LENGTH).append(getClass().getSimpleName()) .append(" [") .append(toStringCoordinates()) .append(", depth=") .append(depth) .append(", cost=") .append(cost) .append(", heuristic=") .append(heuristic) .append(", parent=") .append(parent != null ? '{' + parent.toStringCoordinates() + '}' : null) .append("]") .toString(); } Node(int x, int y); int setParent(Node parent); void setCost(double cost); void setHeuristic(double heuristic); void setDepth(int depth); int getX(); int getY(); double getCost(); Node getParent(); double getHeuristic(); int getDepth(); @Override int compareTo(Node other); @Override boolean equals(Object object); @Override int hashCode(); @Override String toString(); String toStringCoordinates();  }### Answer:
@Test void testToString() { final Node node = new Node(1, 2); assertEquals("Node [x=1, y=2, depth=0, cost=0.0, heuristic=0.0, parent=null]", node.toString()); node.setParent(node); assertEquals("Node [x=1, y=2, depth=1, cost=0.0, heuristic=0.0, parent={x=1, y=2}]", node.toString()); }