OAuthToken { @Override public String toString() { return new ToStringBuilder(this) .append("token", token) .append("secret", secret) .append("attributes", attributes) .toString(); } OAuthToken(String token, String secret);  OAuthToken(String token, String secret, Map<String,String> attributes); String getToken(); String getSecret(); EncodedPair getAttribute(String name); Map<String,String> getAttributes(); @Override String toString();  }
@Test public void shouldReturnAInformativeToString() { String actual = toTest.toString(); assertNotNull(actual); assertEquals("OAuthToken[token=TOKEN,secret=SECRET,attributes={attr1=val%201, attr2=val%202}]", actual); }