StringTrimmingConverter extends StdConverter<String, String> { @Override public String convert(String value) { return (value == null) ? value : value.trim(); }  @Override String convert(String value);  }
@Test public void testRemovesNullBytes() { String in = "Hello world\0"; String out = converter.convert(in); assertEquals("Hello world", out); }
@Test public void testLeavesOtherStringsAlone() { String in = "Hello world"; String out = converter.convert(in); assertEquals(in, out); }
@Test public void testStripsOtherWhiteSpace() { String in = "Hello world "; String out = converter.convert(in); assertEquals("Hello world", out); }