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