### Question:
ProgramEditor extends PropertyEditorSupport { @Override public void setAsText(String text) throws IllegalArgumentException { if (StringUtils.hasText(text)) { try { if (text.startsWith("concept.")) { Integer conceptId = Integer.valueOf(text.substring(text.indexOf('.') + 1)); Concept c = Context.getConceptService().getConcept(conceptId); setValue(Context.getProgramWorkflowService().getProgramByName(c.getName().getName())); } else { Integer programId = Integer.valueOf(text); setValue(Context.getProgramWorkflowService().getProgram(programId)); } } catch (Exception ex) { Program p; if (text.startsWith("concept.")) { Concept c = Context.getConceptService().getConceptByUuid(text.substring(text.indexOf('.') + 1)); p = Context.getProgramWorkflowService().getProgramByName(c.getName().getName()); } else { p = Context.getProgramWorkflowService().getProgramByUuid(text); } setValue(p); if (p == null) { log.error("Error setting text: " + text, ex); throw new IllegalArgumentException("Program not found: " + text, ex); } } } else { setValue(null); } } ProgramEditor(); @Override void setAsText(String text); @Override String getAsText();  }### Answer:
@Test public void setAsText_shouldSetUsingConceptId() { ProgramEditor editor = new ProgramEditor(); editor.setAsText("concept.9"); Assert.assertNotNull(editor.getValue()); }
@Test public void setAsText_shouldSetUsingConceptUuid() { ProgramEditor editor = new ProgramEditor(); editor.setAsText("concept.0a9afe04-088b-44ca-9291-0a8c3b5c96fa"); Assert.assertNotNull(editor.getValue()); }
@Test public void setAsText_shouldSetUsingProgramId() { ProgramEditor editor = new ProgramEditor(); editor.setAsText("1"); Assert.assertNotNull(editor.getValue()); }
@Test public void setAsText_shouldSetUsingProgramUuid() { ProgramEditor editor = new ProgramEditor(); editor.setAsText("da4a0391-ba62-4fad-ad66-1e3722d16380"); Assert.assertNotNull(editor.getValue()); }