### Question:
TaskUtil { public static Task fromTaskData(TaskData taskData) { final Task task = new Task(taskData.getTaskId(), taskData.getProcessInstanceId(), taskData.getProcessId(), taskData.getContainerId(), taskData.getName(), taskData.getPriority(), taskData.getStatus(), taskData.getInputData()); if (taskData.getPotentialOwners() != null) { taskData.getPotentialOwners().forEach(potentialOwner -> { if (isUser(potentialOwner.getType())) { task.getPotentialOwners().add(new User(potentialOwner.getName().hashCode(), potentialOwner.getName())); } else { task.getPotentialOwners().add(new Group(potentialOwner.getName().hashCode(), potentialOwner.getName())); } }); } LabelValueExtractorRegistry.getInstance().applyLabelValueExtractors(TaskData.class, taskData, task::setLabelValues); return task; } private  TaskUtil(); static Task fromTaskData(TaskData taskData);  }### Answer:
@Test public void fromTaskData() { fromTaskData(INPUT_DATA, Collections.emptySet(), Collections.emptySet()); }
@Test public void fromTaskDataWithSkillsAndAffinities() { Map<String, Object> inputData = new HashMap<>(); inputData.put(SKILLS_ATTRIBUTE, String.format("%s, %s,%s", SKILL2, SKILL1, SKILL3)); inputData.put(AFFINITIES_ATTRIBUTE, String.format(" %s, %s", AFFINITY2, AFFINITY1)); fromTaskData(inputData, new HashSet<>(Arrays.asList(SKILL3, SKILL2, SKILL1)), new HashSet<>(Arrays.asList(AFFINITY1, AFFINITY2))); }