@Test
public void stringToEnumWithField() {
TextField tf = new TextField();
tf.setConverter(new ReverseConverter(converter));
tf.setPropertyDataSource(new ObjectProperty(AnotherTestEnum.TWO));
Assert.assertEquals(AnotherTestEnum.TWO.toString(), tf.getValue());
tf.setValue(AnotherTestEnum.ONE.toString());
Assert.assertEquals(AnotherTestEnum.ONE.toString(), tf.getValue());
Assert.assertEquals(AnotherTestEnum.ONE, tf.getConvertedValue());
Assert.assertEquals(AnotherTestEnum.ONE, tf.getPropertyDataSource()
.getValue());
tf.setPropertyDataSource(new ObjectProperty(TestEnum.TWO));
Assert.assertEquals(TestEnum.TWO.toString(), tf.getValue());
tf.setValue(TestEnum.ONE.toString());
Assert.assertEquals(TestEnum.ONE.toString(), tf.getValue());
Assert.assertEquals(TestEnum.ONE, tf.getConvertedValue());
Assert.assertEquals(TestEnum.ONE, tf.getPropertyDataSource().getValue());