WordPos implements Comparable<WordPos>, Serializable { @Override public String toString() { return "WordPos{" + "word='" + word + '\'' + ", tag=" + tag.toString() + '}'; } WordPos();  WordPos(String word, PartOfSpeech tag); WordPos forward(); String getWord(); void setWord(String word); PartOfSpeech getTag(); void setTag(PartOfSpeech tag); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Override int compareTo(WordPos o); @Override String toString();  }
@Test public void testToString() { WordPos wordPos = new WordPos("aWord", PartOfSpeech.NNS); assertEquals(wordPos.toString(), "WordPos{word='aWord', tag=NNS}"); }