Program: 88946
Project: 88946
Buggy source:
@Test public void testUpdateDynamicTasks() throws IOException {
  List<DynamicUserTask> dynamicUserTasks=Lists.newArrayList();
  DynamicUserTask dynamicUserTask=new DynamicUserTask();
  DocType bookReport=DocType.BOOK_REPORT;
  String group="String_Node_Str";
  dynamicUserTask.getCandidateGroups().add(group);
  dynamicUserTask.setIndex(0);
  dynamicUserTask.setDynamicUserTaskType(DynamicUserTaskType.APPROVE_REJECT);
  dynamicUserTasks.add(dynamicUserTask);
  DynamicUserTask dynamicUserTask2=new DynamicUserTask();
  dynamicUserTask2.getCandidateUsers().add("String_Node_Str");
  dynamicUserTask2.setDynamicUserTaskType(DynamicUserTaskType.COLLABORATION);
  dynamicUserTask2.setIndex(1);
  dynamicUserTasks.add(dynamicUserTask2);
  ProcessDefinition pd=this.workflowService.findProcDef(bookReport,group);
  assertNotNull(pd);
  List<DynamicUserTask> tasks=this.workflowBldr.getDynamicTasks(pd);
  assertTrue(tasks.size() == 4);
  ProcessDefinition updatedProcDef=this.workflowBldr.updateDynamicTasks(bookReport,group,dynamicUserTasks);
  assertNotNull(updatedProcDef);
  tasks=this.workflowBldr.getDynamicTasks(updatedProcDef);
  assertTrue(tasks.size() == 2);
  BpmnModel bpmnModel=this.repositoryService.getBpmnModel(updatedProcDef.getId());
  InputStream in=new DefaultProcessDiagramGenerator().generatePngDiagram(bpmnModel);
  FileUtils.copyInputStreamToFile(in,new File("String_Node_Str"));
  IOUtils.closeQuietly(in);
  LOG.debug("String_Node_Str");
  byte[] bytes=new BpmnXMLConverter().convertToXML(bpmnModel,"String_Node_Str");
  FileUtils.writeByteArrayToFile(new File("String_Node_Str"),bytes);
  LOG.debug("String_Node_Str");
}

Fixed version (ground truth):
@Test @DirtiesContext public void testUpdateDynamicTasks() throws IOException {
  List<DynamicUserTask> dynamicUserTasks=Lists.newArrayList();
  DynamicUserTask dynamicUserTask=new DynamicUserTask();
  DocType bookReport=DocType.BOOK_REPORT;
  String group="String_Node_Str";
  dynamicUserTask.getCandidateGroups().add(group);
  dynamicUserTask.setIndex(0);
  dynamicUserTask.setDynamicUserTaskType(DynamicUserTaskType.APPROVE_REJECT);
  dynamicUserTasks.add(dynamicUserTask);
  DynamicUserTask dynamicUserTask2=new DynamicUserTask();
  dynamicUserTask2.getCandidateUsers().add("String_Node_Str");
  dynamicUserTask2.setDynamicUserTaskType(DynamicUserTaskType.COLLABORATION);
  dynamicUserTask2.setIndex(1);
  dynamicUserTasks.add(dynamicUserTask2);
  ProcessDefinition pd=this.workflowService.findProcDef(bookReport,group);
  assertNotNull(pd);
  List<DynamicUserTask> tasks=this.workflowBldr.getDynamicTasks(pd);
  assertTrue(tasks.size() == 4);
  ProcessDefinition updatedProcDef=this.workflowBldr.updateDynamicTasks(bookReport,group,dynamicUserTasks);
  assertNotNull(updatedProcDef);
  tasks=this.workflowBldr.getDynamicTasks(updatedProcDef);
  assertTrue(tasks.size() == 2);
  BpmnModel bpmnModel=this.repositoryService.getBpmnModel(updatedProcDef.getId());
  InputStream in=new DefaultProcessDiagramGenerator().generatePngDiagram(bpmnModel);
  FileUtils.copyInputStreamToFile(in,new File("String_Node_Str"));
  IOUtils.closeQuietly(in);
  LOG.debug("String_Node_Str");
  byte[] bytes=new BpmnXMLConverter().convertToXML(bpmnModel,"String_Node_Str");
  FileUtils.writeByteArrayToFile(new File("String_Node_Str"),bytes);
  LOG.debug("String_Node_Str");
}