### Question:
CustomTaskFactory implements DefinitionFactory<CustomTask> { @Override public CustomTask build(final String identifier) { final String name = BindableAdapterUtils.getDynamicId(CustomTask.class, identifier); return null != name ? buildItem(name) : CustomTaskBuilder.newInstance(); } protected  CustomTaskFactory(); @Inject  CustomTaskFactory(final Instance<WorkItemDefinitionRegistry> registry);  CustomTaskFactory(final Supplier<WorkItemDefinitionRegistry> registry); @Override boolean accepts(final String identifier); @Override CustomTask build(final String identifier); CustomTask buildItem(final String workItemName);  }### Answer:
@Test public void testBuild() { final CustomTask customTask = tested.build(getWorkItemDefinitionName()); assertEquals(WID_NAME, customTask.getName()); assertEquals(WID_NAME, customTask.getTaskType().getRawType()); assertEquals(WID_NAME, customTask.getExecutionSet().getTaskName().getValue()); assertEquals(WID_CAT, customTask.getCategory()); assertEquals(WID_HANDLER, customTask.getDefaultHandler()); assertEquals(WID_DISP_NAME, customTask.getGeneral().getName().getValue()); assertEquals(WID_DOC, customTask.getGeneral().getDocumentation().getValue()); assertEquals(WID_DESC, customTask.getDescription()); assertEquals(WID_PARAMS + WID_RESULTS, customTask.getDataIOSet().getAssignmentsinfo().getValue()); }