### Question:
DateTimeEditor extends PropertyEditorSupport { @Override public void setAsText(String text) { if (text != null && !text.isEmpty()) { DateTimeFormatter dateTimeFormatter = DateTimeFormat.forPattern(this.format); try { setValue(dateTimeFormatter.parseDateTime(text)); } catch (IllegalArgumentException e) { setValue(null); } } } DateTimeEditor(String format); @Override String getAsText(); @Override void setAsText(String text);  }### Answer:
@Test public void valueIsInvalid() { editor.setAsText(null); assertEquals(null, editor.getValue()); }
@Test public void setAsTextNotMatchingFormatStingShouldNotSetValue() { editor.setAsText("99999-08-2014"); assertEquals(null, editor.getValue()); }
@Test public void setValueAsSimpleString() { editor.setAsText("string"); assertEquals(null, editor.getValue()); }