### Question:
PrivilegeEditor extends PropertyEditorSupport { @Override public void setAsText(String text) throws IllegalArgumentException { UserService es = Context.getUserService(); if (StringUtils.hasText(text)) { try { Privilege p = es.getPrivilege(text); setValue(p); if (p == null) { throw new Exception(); } } catch (Exception ex) { Privilege p = es.getPrivilegeByUuid(text); setValue(p); if (p == null) { log.error("Error setting text: " + text, ex); throw new IllegalArgumentException("Privilege not found: " + ex.getMessage()); } } } else { setValue(null); } } PrivilegeEditor(); @Override void setAsText(String text); @Override String getAsText();  }### Answer:
@Test public void setAsText_shouldSetUsingName() { PrivilegeEditor editor = new PrivilegeEditor(); editor.setAsText("Some Privilege"); Assert.assertNotNull(editor.getValue()); }
@Test public void setAsText_shouldSetUsingUuid() { PrivilegeEditor editor = new PrivilegeEditor(); editor.setAsText("d979d066-15e6-467c-9d4b-cb575ef97f0f"); Assert.assertNotNull(editor.getValue()); }