EnumFormatter implements ValueFormatter<Enum<?>>, Serializable { @Override public String format(Enum<?> value) { if (value == null) { return SimpleValueContainer.DEFAULT_NULL_STRING; } else { return value.name(); } }  @Override String format(Enum<?> value);  }
@Test public void testFormat() { EnumFormatter formatter = new EnumFormatter(); assertThat(formatter.format(null), equalTo(ValueContainer.DEFAULT_NULL_STRING)); assertThat(formatter.format(CustomEnum.VALUE_1), equalTo("VALUE_1")); }