Program: 189077
Project: 189077
Buggy source:
@Test public void testACLWithAllObjects(){
  ModelManager mManager=Factory.getModelManager();
  Group newGroup=mManager.buildGroup().setName("String_Node_Str").setDescription("String_Node_Str").build();
  User newUser=mManager.buildUser().setFirstName("String_Node_Str").setLastName("String_Node_Str").setEmailAddress("String_Node_Str").setPassword("String_Node_Str").build();
  ACL acl=fSet.getPermissions().toBuilder().setOwner(newUser).setGroup(newGroup).build();
  Assert.assertTrue(!(f1 instanceof ACLable));
  Molecule[] mols={a1,fSet,tSet1,rSet,r1,r1,group,viewerGroup,marshmallowUser,titanicUser,aSet,newGroup,newUser};
  for (  Molecule mol : mols) {
    mManager.persist(mol);
    mol.setPermissions(acl);
  }
  mManager.flush();
  for (  Molecule mol : mols) {
    Molecule molFromBackEnd=(Molecule)Factory.getFeatureStoreInterface().getParticleBySGID(mol.getSGID());
    Assert.assertTrue(molFromBackEnd.getPermissions().getOwner().equals(newUser));
    Assert.assertTrue(molFromBackEnd.getPermissions().getGroup().equals(newGroup));
  }
  User newUser2=mManager.buildUser().setFirstName("String_Node_Str").setLastName("String_Node_Str").setEmailAddress("String_Node_Str").setPassword("String_Node_Str").build();
  acl=acl.toBuilder().setOwner(newUser2).setGroup(newGroup).build();
  for (  Molecule mol : mols) {
    mol.setPermissions(acl);
  }
  mManager.flush();
  for (  Molecule mol : mols) {
    Molecule molFromBackEnd=(Molecule)Factory.getFeatureStoreInterface().getParticleBySGID(mol.getSGID());
    Assert.assertTrue(molFromBackEnd.getPermissions().getOwner().equals(newUser2));
    Assert.assertTrue(((Molecule)molFromBackEnd.getPrecedingVersion()).getPermissions().getOwner().equals(newUser));
    Assert.assertTrue(molFromBackEnd.getPermissions().getGroup().equals(newGroup));
  }
}

Fixed version (ground truth):
@Test public void testACLWithAllObjects(){
  ModelManager mManager=Factory.getModelManager();
  Group newGroup=mManager.buildGroup().setName("String_Node_Str").setDescription("String_Node_Str").build();
  User newUser=mManager.buildUser().setFirstName("String_Node_Str").setLastName("String_Node_Str").setEmailAddress("String_Node_Str").setPassword("String_Node_Str").build();
  ACL acl=fSet.getPermissions().toBuilder().setOwner(newUser).setGroup(newGroup).build();
  Assert.assertTrue(!(f1 instanceof ACLable));
  Molecule[] mols={a1,fSet,tSet1,rSet,r1,r1,group,viewerGroup,marshmallowUser,titanicUser,aSet,newGroup,newUser};
  for (  Molecule mol : mols) {
    mManager.persist(mol);
    mol.setPermissions(acl);
  }
  mManager.flush();
  for (  Molecule mol : mols) {
    Molecule molFromBackEnd=(Molecule)Factory.getFeatureStoreInterface().getParticleBySGID(mol.getSGID());
    Assert.assertTrue(molFromBackEnd.getPermissions().getOwner().equals(newUser));
    Assert.assertTrue(molFromBackEnd.getPermissions().getGroup().equals(newGroup));
  }
  User newUser2=mManager.buildUser().setFirstName("String_Node_Str").setLastName("String_Node_Str").setEmailAddress("String_Node_Str").setPassword("String_Node_Str").build();
  acl=acl.toBuilder().setOwner(newUser2).setGroup(newGroup).build();
  for (  Molecule mol : mols) {
    mol.setPermissions(acl);
  }
  mManager.flush();
  for (  Molecule mol : mols) {
    Molecule molFromBackEnd=(Molecule)Factory.getFeatureStoreInterface().getParticleBySGID(mol.getSGID());
    Assert.assertTrue(molFromBackEnd.getPermissions().getOwner().equals(newUser2));
    Assert.assertTrue(((Molecule)molFromBackEnd.getPrecedingVersion()).getPermissions().getOwner().equals(newUser));
    Assert.assertTrue(molFromBackEnd.getPermissions().getGroup().equals(newGroup));
  }
  mManager.close();
}