Tag { @Override public String toString() { return '@' + text; } Tag(int line, String text); int getLine(); String getText(); String getName(); List<String> getValues(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testToString() { assertEquals("@foo=bar,baz", new Tag(5, "@foo=bar,baz").toString()); assertEquals("@foo=", new Tag(5, "@foo=").toString()); assertEquals("@foobar,baz", new Tag(5, "@foobar,baz").toString()); }