@Test public void shouldReturnStringRepresentation() throws UnsupportedEncodingException { PostData data = postData(); assertEquals("&user=john&password=password&sender=1982&text=hello+world",data.toString()); }
public String toString(){ StringBuilder builder = new StringBuilder(); for(String key : data.keySet()){ builder.append("&").append(key).append("=").append(data.get(key)); } return builder.toString(); }
PostData { public String toString(){ StringBuilder builder = new StringBuilder(); for(String key : data.keySet()){ builder.append("&").append(key).append("=").append(data.get(key)); } return builder.toString(); } }
PostData { public String toString(){ StringBuilder builder = new StringBuilder(); for(String key : data.keySet()){ builder.append("&").append(key).append("=").append(data.get(key)); } return builder.toString(); }  }
PostData { public String toString(){ StringBuilder builder = new StringBuilder(); for(String key : data.keySet()){ builder.append("&").append(key).append("=").append(data.get(key)); } return builder.toString(); }  void add(String attribute, String value, String urlEncoding); void add(String attribute, String value); String toString(); String without(String... values); }
PostData { public String toString(){ StringBuilder builder = new StringBuilder(); for(String key : data.keySet()){ builder.append("&").append(key).append("=").append(data.get(key)); } return builder.toString(); }  void add(String attribute, String value, String urlEncoding); void add(String attribute, String value); String toString(); String without(String... values);  }