WordPosCap implements Comparable<WordPosCap>, Serializable { @Override public String toString() { return "WordPosCap{" + "word='" + word + '\'' + ", partOfSpeech=" + partOfSpeech.toString() + ", isCapitalized=" + isCapitalized + '}'; } WordPosCap(String word, PartOfSpeech partOfSpeech, boolean isCapitalized); String getWord(); PartOfSpeech getPartOfSpeech(); boolean isCapitalized(); PosCap toPosCap(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Override int compareTo(WordPosCap o); @Override String toString();  }
@Test public void testToString() { WordPosCap wordPosCap = new WordPosCap("aWord", PartOfSpeech.NN, false); assertEquals(wordPosCap.toString(), "WordPosCap{word='aWord', partOfSpeech=NN, isCapitalized=false}"); }