Result implements Serializable { @Override public String toString() { return new ToStringBuilder(this).append("dataLength", data != null ? data.length() : 0) .append("messages", messages, false).toString(); } @SuppressWarnings("unchecked")  Result(String data);  Result(List<String> messages);  Result(String data, List<String> messages); String getData(); List<String> getMessages(); boolean isSuccessful(); @Override String toString();  }
@Test public void testToString() { toStringPrint(result); }