Token { @Override public String toString() { return String.valueOf(value); } Token(int index, int length, Object value); int length(); int index(); Object value(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testToString() { assertEquals("value", new Token(1, 2, "value").toString()); assertEquals("null", new Token(1, 2, null).toString()); }