SelectOption implements Comparable<SelectOption> { @Override public String toString() { return "{text=" + text + ", value=" + value + "}"; } SelectOption(String value, String text); String getText(); String getValue(); @Override int hashCode(); @Override boolean equals(Object obj); @Override int compareTo(SelectOption other); @Override String toString();  }
@Test public void testToString() { assertThat(instance.toString(), equalTo(String.format("{text=%s, value=%s}", text, value))); }