StringToEnumConverterFactory implements ConverterFactory<String, Enum> { @Override public <T extends Enum> Converter<String, T> getConverter(Class<T> targetType) { return new StringToEnumConverter(targetType); }  @Override Converter<String, T> getConverter(Class<T> targetType);  }
@Test public void getConverter() { Converter<String, ? extends Enum> converter = factory.getConverter(TestEnum.class); Assert.assertThat(converter.convert(null), nullValue()); Assert.assertThat(converter.convert(""), nullValue()); Assert.assertThat(converter.convert("ONE"), is((Object) TestEnum.ONE)); }