PrecisionEditor extends PropertyEditorSupport { public String getAsText() { if (getValue() != null) { return getValue().toString(); } return null; } PrecisionEditor();  PrecisionEditor(Object source); String getAsText(); void setAsText(String text);  }
@Test public void testGetAsText() { editor.setValue(Precision.MILLISECOND); Assert.assertEquals("millisecond", editor.getAsText()); editor.setValue(Precision.SECOND); Assert.assertEquals("second", editor.getAsText()); editor.setValue(Precision.MINUTE); Assert.assertEquals("minute", editor.getAsText()); editor.setValue(Precision.HOUR); Assert.assertEquals("hour", editor.getAsText()); editor.setValue(Precision.DATE); Assert.assertEquals("date", editor.getAsText()); editor.setValue(Precision.MONTH); Assert.assertEquals("month", editor.getAsText()); editor.setValue(Precision.YEAR); Assert.assertEquals("year", editor.getAsText()); }