Source:
<code>private Long createEncounterTestTask() { TaskTriggerInformation triggerInformation = new TaskTriggerInformation("CREATE SettingsRecord", "data-services", MDS_CHANNEL_NAME, VERSION, TRIGGER_SUBJECT, TRIGGER_SUBJECT); TaskActionInformation actionInformation = new TaskActionInformation("Create Encounter [" + DEFAULT_CONFIG_NAME + "]", OPENMRS_CHANNEL_NAME, OPENMRS_CHANNEL_NAME, VERSION, TEST_INTERFACE, "createEncounter"); actionInformation.setSubject(String.format("createEncounter.%s", DEFAULT_CONFIG_NAME)); SortedSet<TaskConfigStep> taskConfigStepSortedSet = new TreeSet<>(); taskConfigStepSortedSet.add(createEncounterDataSource()); TaskConfig taskConfig = new TaskConfig( ); taskConfig.addAll(taskConfigStepSortedSet); Map<String, String> values = new HashMap<>(); values.put(Keys.PROVIDER_UUID, createdProvider.getUuid()); values.put(Keys.PATIENT_UUID, "{{ad.openMRS.Encounter-" + DEFAULT_CONFIG_NAME + "#0.patient.uuid}}"); values.put(Keys.ENCOUNTER_TYPE, "{{ad.openMRS.Encounter-" + DEFAULT_CONFIG_NAME + "#0.encounterType.name}}"); values.put(Keys.ENCOUNTER_DATE, new DateTime("1999-01-16T00:00:00Z").toString()); values.put(Keys.LOCATION_NAME, "{{ad.openMRS.Encounter-" + DEFAULT_CONFIG_NAME + "#0.location.display}}"); values.put(Keys.CONFIG_NAME, DEFAULT_CONFIG_NAME); actionInformation.setValues(values); <START> Task task = new Task("OpenMRSEncounterTestTask", triggerInformation, Arrays.asList(actionInformation), taskConfig, true, true); <END> getTaskService().save(task); getTriggerHandler().registerHandlerFor(task.getTrigger().getEffectiveListenerSubject()); return task.getId(); }</code><technical_language>singletonList</technical_language>

Target:
private Long createEncounterTestTask() { TaskTriggerInformation triggerInformation = new TaskTriggerInformation("CREATE SettingsRecord", "data-services", MDS_CHANNEL_NAME, VERSION, TRIGGER_SUBJECT, TRIGGER_SUBJECT); TaskActionInformation actionInformation = new TaskActionInformation("Create Encounter [" + DEFAULT_CONFIG_NAME + "]", OPENMRS_CHANNEL_NAME, OPENMRS_CHANNEL_NAME, VERSION, TEST_INTERFACE, "createEncounter"); actionInformation.setSubject(String.format("createEncounter.%s", DEFAULT_CONFIG_NAME)); SortedSet<TaskConfigStep> taskConfigStepSortedSet = new TreeSet<>(); taskConfigStepSortedSet.add(createEncounterDataSource()); TaskConfig taskConfig = new TaskConfig( ); taskConfig.addAll(taskConfigStepSortedSet); Map<String, String> values = new HashMap<>(); values.put(Keys.PROVIDER_UUID, createdProvider.getUuid()); values.put(Keys.PATIENT_UUID, "{{ad.openMRS.Encounter-" + DEFAULT_CONFIG_NAME + "#0.patient.uuid}}"); values.put(Keys.ENCOUNTER_TYPE, "{{ad.openMRS.Encounter-" + DEFAULT_CONFIG_NAME + "#0.encounterType.name}}"); values.put(Keys.ENCOUNTER_DATE, new DateTime("1999-01-16T00:00:00Z").toString()); values.put(Keys.LOCATION_NAME, "{{ad.openMRS.Encounter-" + DEFAULT_CONFIG_NAME + "#0.location.display}}"); values.put(Keys.CONFIG_NAME, DEFAULT_CONFIG_NAME); actionInformation.setValues(values); Task task = new Task("OpenMRSEncounterTestTask", triggerInformation, Collections.singletonList(actionInformation), taskConfig, true, true); getTaskService().save(task); getTriggerHandler().registerHandlerFor(task.getTrigger().getEffectiveListenerSubject()); return task.getId(); }