BrowserType implements Identifiable, Serializable { @Override public String toString() { final StringBuilder builder = new StringBuilder(); builder.append("BrowserType [id="); builder.append(id); builder.append(", name="); builder.append(name); builder.append("]"); return builder.toString(); } BrowserType(@Nonnegative final int id, @Nonnull final String name); @Override boolean equals(final Object obj); @Override int getId(); String getName(); @Override int hashCode(); @Override String toString();  }
@Test public void testToString() { final BrowserType type = new BrowserType(1, "Email client"); assertThat(type.toString()).isEqualTo("BrowserType [id=1, name=Email client]"); }