Program: 61048
Project: 61048
Buggy source:
@Test public final void create(){
  List<PropagationTaskTO> tasks=Arrays.asList(restTemplate.getForObject(BASE_URL + "String_Node_Str",PropagationTaskTO[].class));
  assertNotNull(tasks);
  assertFalse(tasks.isEmpty());
  long maxId=Long.MIN_VALUE;
  for (  PropagationTaskTO task : tasks) {
    if (task.getId() > maxId) {
      maxId=task.getId();
    }
  }
  UserTO userTO=getSampleTO("String_Node_Str");
  MembershipTO membershipTO=new MembershipTO();
  membershipTO.setRoleId(8L);
  userTO.addMembership(membershipTO);
  AttributeTO nullValueAttributeTO=new AttributeTO();
  nullValueAttributeTO.setSchema("String_Node_Str");
  nullValueAttributeTO.setValues(null);
  membershipTO.addAttribute(nullValueAttributeTO);
  AttributeTO attrWithInvalidSchemaTO=new AttributeTO();
  attrWithInvalidSchemaTO.setSchema("String_Node_Str");
  attrWithInvalidSchemaTO.addValue("String_Node_Str");
  userTO.addAttribute(attrWithInvalidSchemaTO);
  nullValueAttributeTO=new AttributeTO();
  nullValueAttributeTO.setSchema("String_Node_Str");
  nullValueAttributeTO.addValue(null);
  userTO.addAttribute(nullValueAttributeTO);
  UserTO newUserTO=restTemplate.postForObject(BASE_URL + "String_Node_Str",userTO,UserTO.class);
  assertNotNull(newUserTO);
  assertFalse(newUserTO.getAttributes().contains(attrWithInvalidSchemaTO));
  WorkflowActionsTO workflowActions=restTemplate.getForObject(BASE_URL + "String_Node_Str",WorkflowActionsTO.class,newUserTO.getId());
  assertTrue(workflowActions.getActions().equals(Collections.singleton(Constants.ACTION_ACTIVATE)));
  newUserTO=restTemplate.postForObject(BASE_URL + "String_Node_Str",newUserTO,UserTO.class);
  assertEquals("String_Node_Str",restTemplate.getForObject(BASE_URL + "String_Node_Str" + newUserTO.getId(),String.class));
  newUserTO=restTemplate.getForObject(BASE_URL + "String_Node_Str",UserTO.class,newUserTO.getId());
  assertNotNull(newUserTO);
  assertNotNull(newUserTO.getVirtualAttributeMap());
  assertNotNull(newUserTO.getVirtualAttributeMap().get("String_Node_Str"));
  assertFalse(newUserTO.getVirtualAttributeMap().get("String_Node_Str").isEmpty());
  assertEquals(newUserTO.getVirtualAttributeMap().get("String_Node_Str").get(0),"String_Node_Str");
  tasks=Arrays.asList(restTemplate.getForObject(BASE_URL + "String_Node_Str",PropagationTaskTO[].class));
  assertNotNull(tasks);
  assertFalse(tasks.isEmpty());
  long newMaxId=Long.MIN_VALUE;
  for (  PropagationTaskTO task : tasks) {
    if (task.getId() > newMaxId) {
      newMaxId=task.getId();
    }
  }
  assertEquals(newMaxId,maxId);
  PropagationTaskTO taskTO=restTemplate.getForObject(BASE_URL + "String_Node_Str",PropagationTaskTO.class,newMaxId);
  assertNotNull(taskTO);
  assertTrue(taskTO.getExecutions().isEmpty());
  Boolean verify=restTemplate.getForObject(BASE_URL + "String_Node_Str",Boolean.class,newUserTO.getId());
  assertTrue(verify);
  verify=restTemplate.getForObject(BASE_URL + "String_Node_Str",Boolean.class,newUserTO.getId());
  assertFalse(verify);
  userTO=getSampleTO("String_Node_Str");
  for (  AttributeTO attr : userTO.getAttributes()) {
    if ("String_Node_Str".equals(attr.getSchema())) {
      attr.getValues().clear();
      attr.addValue("String_Node_Str");
    }
  }
  SyncopeClientException sce=null;
  try {
    restTemplate.postForObject(BASE_URL + "String_Node_Str",userTO,UserTO.class);
  }
 catch (  SyncopeClientCompositeErrorException e) {
    sce=e.getException(SyncopeClientExceptionType.DuplicateUniqueValue);
  }
  assertNotNull(sce);
}

Fixed version (ground truth):
@Test public final void create(){
  List<PropagationTaskTO> tasks=Arrays.asList(restTemplate.getForObject(BASE_URL + "String_Node_Str",PropagationTaskTO[].class));
  assertNotNull(tasks);
  assertFalse(tasks.isEmpty());
  long maxId=Long.MIN_VALUE;
  for (  PropagationTaskTO task : tasks) {
    if (task.getId() > maxId) {
      maxId=task.getId();
    }
  }
  PropagationTaskTO taskTO=restTemplate.getForObject(BASE_URL + "String_Node_Str",PropagationTaskTO.class,maxId);
  assertNotNull(taskTO);
  int maxTaskExecutions=taskTO.getExecutions().size();
  UserTO userTO=getSampleTO("String_Node_Str");
  MembershipTO membershipTO=new MembershipTO();
  membershipTO.setRoleId(8L);
  userTO.addMembership(membershipTO);
  AttributeTO nullValueAttributeTO=new AttributeTO();
  nullValueAttributeTO.setSchema("String_Node_Str");
  nullValueAttributeTO.setValues(null);
  membershipTO.addAttribute(nullValueAttributeTO);
  AttributeTO attrWithInvalidSchemaTO=new AttributeTO();
  attrWithInvalidSchemaTO.setSchema("String_Node_Str");
  attrWithInvalidSchemaTO.addValue("String_Node_Str");
  userTO.addAttribute(attrWithInvalidSchemaTO);
  nullValueAttributeTO=new AttributeTO();
  nullValueAttributeTO.setSchema("String_Node_Str");
  nullValueAttributeTO.addValue(null);
  userTO.addAttribute(nullValueAttributeTO);
  UserTO newUserTO=restTemplate.postForObject(BASE_URL + "String_Node_Str",userTO,UserTO.class);
  assertNotNull(newUserTO);
  assertFalse(newUserTO.getAttributes().contains(attrWithInvalidSchemaTO));
  WorkflowActionsTO workflowActions=restTemplate.getForObject(BASE_URL + "String_Node_Str",WorkflowActionsTO.class,newUserTO.getId());
  assertTrue(workflowActions.getActions().equals(Collections.singleton(Constants.ACTION_ACTIVATE)));
  newUserTO=restTemplate.postForObject(BASE_URL + "String_Node_Str",newUserTO,UserTO.class);
  assertEquals("String_Node_Str",restTemplate.getForObject(BASE_URL + "String_Node_Str" + newUserTO.getId(),String.class));
  newUserTO=restTemplate.getForObject(BASE_URL + "String_Node_Str",UserTO.class,newUserTO.getId());
  assertNotNull(newUserTO);
  assertNotNull(newUserTO.getVirtualAttributeMap());
  assertNotNull(newUserTO.getVirtualAttributeMap().get("String_Node_Str"));
  assertFalse(newUserTO.getVirtualAttributeMap().get("String_Node_Str").isEmpty());
  assertEquals(newUserTO.getVirtualAttributeMap().get("String_Node_Str").get(0),"String_Node_Str");
  tasks=Arrays.asList(restTemplate.getForObject(BASE_URL + "String_Node_Str",PropagationTaskTO[].class));
  assertNotNull(tasks);
  assertFalse(tasks.isEmpty());
  long newMaxId=Long.MIN_VALUE;
  for (  PropagationTaskTO task : tasks) {
    if (task.getId() > newMaxId) {
      newMaxId=task.getId();
    }
  }
  assertEquals(newMaxId,maxId);
  taskTO=restTemplate.getForObject(BASE_URL + "String_Node_Str",PropagationTaskTO.class,newMaxId);
  assertNotNull(taskTO);
  assertEquals(maxTaskExecutions,taskTO.getExecutions().size());
  Boolean verify=restTemplate.getForObject(BASE_URL + "String_Node_Str",Boolean.class,newUserTO.getId());
  assertTrue(verify);
  verify=restTemplate.getForObject(BASE_URL + "String_Node_Str",Boolean.class,newUserTO.getId());
  assertFalse(verify);
  userTO=getSampleTO("String_Node_Str");
  for (  AttributeTO attr : userTO.getAttributes()) {
    if ("String_Node_Str".equals(attr.getSchema())) {
      attr.getValues().clear();
      attr.addValue("String_Node_Str");
    }
  }
  SyncopeClientException sce=null;
  try {
    restTemplate.postForObject(BASE_URL + "String_Node_Str",userTO,UserTO.class);
  }
 catch (  SyncopeClientCompositeErrorException e) {
    sce=e.getException(SyncopeClientExceptionType.DuplicateUniqueValue);
  }
  assertNotNull(sce);
}