### Question:
EnumEditor extends PropertyEditorSupport { @SuppressWarnings("unchecked") @Override public void setAsText(String text) { if (allowEmpty && Strings.isEmpty(text)) { setValue(null); } else if (!allowEmpty && Strings.isEmpty(text)) { throw new PropertyEditingException(CODE, Editors.REQUIRED_MESSAGE); } else { try { setValue(Enum.valueOf(this.enumType, text.trim())); } catch (IllegalArgumentException e) { throw new PropertyEditingException(CODE, Strings.substitute(message, Maps.hash("pattern", generatePattern()))); } } } <T extends Enum> EnumEditor(Class<T> enumType); <T extends Enum> EnumEditor(boolean allowEmpty, Class<T> enumType); <T extends Enum> EnumEditor(Class<T> enumType, String message); <T extends Enum> EnumEditor(boolean allowEmpty, Class<T> enumType, String message); @SuppressWarnings("unchecked") @Override void setAsText(String text); @Override String getAsText();  }### Answer:
@Test public void null値の変換を許可しない() { try { EnumEditor editor = new EnumEditor(false, TestEnum.class); editor.setAsText(null); fail(); } catch (PropertyEditingException ex) { assertThat(ex.getMessage(), is("必須入力です。")); } }