CharSequenceNodeNonLeafNullValue implements Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("Node{"); sb.append("edge=").append(incomingEdgeCharSequence); sb.append(", value=null"); sb.append(", edges=").append(getOutgoingEdges()); sb.append("}"); return sb.toString(); } CharSequenceNodeNonLeafNullValue(CharSequence edgeCharSequence, List<Node> outgoingEdges); @Override CharSequence getIncomingEdge(); @Override Character getIncomingEdgeFirstCharacter(); @Override Object getValue(); @Override Node getOutgoingEdge(Character edgeFirstCharacter); @Override void updateOutgoingEdge(Node childNode); @Override List<Node> getOutgoingEdges(); @Override String toString();  }
@Test public void testToString() throws Exception { Node node = new CharSequenceNodeNonLeafNullValue("FOO", Collections.<Node>emptyList()); Assert.assertEquals("Node{edge=FOO, value=null, edges=[]}", node.toString()); }