### Question:
RoleEditor extends PropertyEditorSupport { @Override public void setAsText(String text) throws IllegalArgumentException { UserService es = Context.getUserService(); if (StringUtils.hasText(text)) { try { Role r = es.getRole(text); setValue(r); if (r == null) { throw new Exception(); } } catch (Exception ex) { Role r = es.getRoleByUuid(text); setValue(r); if (r == null) { log.error("Error setting text: " + text, ex); throw new IllegalArgumentException("Role not found: " + ex.getMessage()); } } } else { setValue(null); } } RoleEditor(); @Override void setAsText(String text); @Override String getAsText();  }### Answer:
@Test public void setAsText_shouldSetUsingName() { RoleEditor editor = new RoleEditor(); editor.setAsText("Provider"); Assert.assertNotNull(editor.getValue()); }
@Test public void setAsText_shouldSetUsingUuid() { RoleEditor editor = new RoleEditor(); editor.setAsText("3480cb6d-c291-46c8-8d3a-96dc33d199fb"); Assert.assertNotNull(editor.getValue()); }