Program: 65931
Project: 65931
Buggy source:
public void testValidateMafiaFamily707(){
  EntityManager em=createEntityManager(MULTI_TENANT_PU);
  em.setProperty("String_Node_Str",707);
  em.setProperty("String_Node_Str",707);
  try {
    clearCache(MULTI_TENANT_PU);
    em.clear();
    MafiaFamily family=em.find(MafiaFamily.class,family707);
    assertNotNull("String_Node_Str" + family707 + "String_Node_Str",family);
    assertTrue("String_Node_Str" + family.getTags().size() + "String_Node_Str",family.getTags().size() == 3);
    assertNull("String_Node_Str" + family007 + "String_Node_Str",em.find(MafiaFamily.class,family007));
    assertNull("String_Node_Str" + family123 + "String_Node_Str",em.find(MafiaFamily.class,family123));
    assertFalse("String_Node_Str",family.getMafiosos().isEmpty());
    for (    Integer id : family007Mafiosos) {
      assertNull("String_Node_Str",em.find(Mafioso.class,id));
    }
    Boss otherBoss=em.find(Boss.class,family007Mafiosos.get(0));
    assertNull("String_Node_Str",otherBoss);
    for (    Integer id : family007Contracts) {
      assertNull("String_Node_Str",em.find(Contract.class,id));
    }
    List soldiers=em.createQuery("String_Node_Str").getResultList();
    assertTrue("String_Node_Str" + soldiers.size() + "String_Node_Str",soldiers.size() == 5);
    beginTransaction(em);
    Query query=em.createNamedQuery("String_Node_Str");
    query.setParameter("String_Node_Str","String_Node_Str");
    query.setParameter("String_Node_Str",family007Mafiosos.get(0));
    query.executeUpdate();
    commitTransaction(em);
  }
 catch (  RuntimeException e) {
    if (isTransactionActive(em)) {
      rollbackTransaction(em);
    }
    throw e;
  }
 finally {
    closeEntityManager(em);
  }
}

Fixed version (ground truth):
public void testValidateMafiaFamily707(){
  EntityManager em=createEntityManager(MULTI_TENANT_PU);
  em.setProperty("String_Node_Str","String_Node_Str");
  em.setProperty("String_Node_Str","String_Node_Str");
  try {
    clearCache(MULTI_TENANT_PU);
    em.clear();
    MafiaFamily family=em.find(MafiaFamily.class,family707);
    assertNotNull("String_Node_Str" + family707 + "String_Node_Str",family);
    assertTrue("String_Node_Str" + family.getTags().size() + "String_Node_Str",family.getTags().size() == 3);
    assertNull("String_Node_Str" + family007 + "String_Node_Str",em.find(MafiaFamily.class,family007));
    assertNull("String_Node_Str" + family123 + "String_Node_Str",em.find(MafiaFamily.class,family123));
    assertFalse("String_Node_Str",family.getMafiosos().isEmpty());
    for (    Integer id : family007Mafiosos) {
      assertNull("String_Node_Str",em.find(Mafioso.class,id));
    }
    Boss otherBoss=em.find(Boss.class,family007Mafiosos.get(0));
    assertNull("String_Node_Str",otherBoss);
    for (    Integer id : family007Contracts) {
      assertNull("String_Node_Str",em.find(Contract.class,id));
    }
    List soldiers=em.createQuery("String_Node_Str").getResultList();
    assertTrue("String_Node_Str" + soldiers.size() + "String_Node_Str",soldiers.size() == 5);
    beginTransaction(em);
    Query query=em.createNamedQuery("String_Node_Str");
    query.setParameter("String_Node_Str","String_Node_Str");
    query.setParameter("String_Node_Str",family007Mafiosos.get(0));
    query.executeUpdate();
    commitTransaction(em);
  }
 catch (  RuntimeException e) {
    if (isTransactionActive(em)) {
      rollbackTransaction(em);
    }
    throw e;
  }
 finally {
    closeEntityManager(em);
  }
}