FilterReport { @Override public String toString() { return String.format("FilterReport for %s: pass:%d fail:%d %s", filterType, passed, failed, messages); } FilterReport(FilterType filterType, int pass, int fail, List<String> messages); FilterType getFilterType(); List<String> getMessages(); boolean hasMessages(); int getPassed(); int getFailed(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }
@Test public void testToString() { String expResult = String.format("FilterReport for %s: pass:%d fail:%d %s", FilterType.FREQUENCY_FILTER, PASSED, FAILED, ImmutableList.of(MESSAGE)); assertThat(instance.toString(), equalTo(expResult)); }