ToStringSerializer extends StringSerializer<T> { public String serialize(T value, Charset charset) { return value.toString(); }  String serialize(T value, Charset charset);  }
@Test public void shouldReturnToStringValueOfObject(){ assertEquals("hello", toTest.serialize(this, null)); }
@Test(expected = NullPointerException.class) public void shouldFailWithNull(){ toTest.serialize(null, null); }