### Question:
NullHandlingConverter implements Converter<T> { public T fromString(String representation) { return representation == null ? null : fromNonNullableString(representation); }  T fromString(String representation); String toString(T value);  }### Answer:
@Test public void fromNullString() throws Exception { Converter<Boolean> converter = new NullHandlingConverter<Boolean>() { @Override protected Boolean fromNonNullableString(String representation) { throw new UnsupportedOperationException(); } @Override protected String nonNullableToString(Boolean value) { throw new UnsupportedOperationException(); } }; assertNull(converter.fromString(null)); }
@Test public void fromNotNullString() throws Exception { Converter<Boolean> converter = new NullHandlingConverter<Boolean>() { @Override protected Boolean fromNonNullableString(String representation) { return true; } @Override protected String nonNullableToString(Boolean value) { throw new UnsupportedOperationException(); } }; assertTrue(converter.fromString("")); }