Location { @Override public String toString() { return "line " + line + " column "+column; } Location(int line, int column); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); final int line; final int column; }
@Test public void testToString() { assertEquals("line 1 column 2", new Location(1, 2).toString()); }