### Question:
CharsetConverterFactory implements TypeConverterFactory<String, Charset> { @Override public TypeConverter<String, Charset> createTypeConverter() { return value -> { try { return Charset.forName(value); } catch (UnsupportedCharsetException e) { throw new TypeConverterException("Unsupported character set '" + value + "'."); } }; }  @Override TypeConverter<String, Charset> createTypeConverter(); @Override TypeConverterDescriptor<Class<String>, Class<Charset>> getTypeConverterDescriptor();  }### Answer:
@Test public void test_CharsetDecoder() { new CharsetConverterFactory().createTypeConverter().convert("UTF-8"); try { new CharsetConverterFactory().createTypeConverter().convert("XXXXXX"); } catch(TypeConverterException e) { assertEquals("Unsupported character set 'XXXXXX'.", e.getMessage()); } }