Program: 176619
Project: 176619
Buggy source:
/** 
 * On insert mongo.
 */
@Test public void onInsertMongo() throws Exception {
  Object p1=prepareMongoInstance("String_Node_Str",10);
  Object p2=prepareMongoInstance("String_Node_Str",20);
  Object p3=prepareMongoInstance("String_Node_Str",15);
  Query findQuery=em.createQuery("String_Node_Str");
  List<PersonMongo> allPersons=findQuery.getResultList();
  Assert.assertNotNull(allPersons);
  Assert.assertTrue(allPersons.isEmpty());
  findQuery=em.createQuery("String_Node_Str");
  allPersons=findQuery.getResultList();
  Assert.assertNotNull(allPersons);
  Assert.assertTrue(allPersons.isEmpty());
  findQuery=em.createQuery("String_Node_Str");
  allPersons=findQuery.getResultList();
  Assert.assertNotNull(allPersons);
  Assert.assertTrue(allPersons.isEmpty());
  em.persist(p1);
  em.persist(p2);
  em.persist(p3);
  col.put("String_Node_Str",p1);
  col.put("String_Node_Str",p2);
  col.put("String_Node_Str",p3);
  em.clear();
  PersonMongo p=findById(PersonMongo.class,"String_Node_Str",em);
  Assert.assertNotNull(p);
  Assert.assertEquals(Day.FRIDAY,p.getDay());
  Assert.assertEquals("String_Node_Str",p.getPersonName());
  assertFindByName(em,"String_Node_Str",PersonMongo.class,"String_Node_Str","String_Node_Str");
  assertFindByNameAndAge(em,"String_Node_Str",PersonMongo.class,"String_Node_Str","String_Node_Str","String_Node_Str");
  assertFindByNameAndAgeGTAndLT(em,"String_Node_Str",PersonMongo.class,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  assertFindByNameAndAgeBetween(em,"String_Node_Str",PersonMongo.class,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  assertFindByRange(em,"String_Node_Str",PersonMongo.class,"String_Node_Str","String_Node_Str","String_Node_Str");
  assertFindWithoutWhereClause(em,"String_Node_Str",PersonMongo.class);
  Query query=em.createNamedQuery("String_Node_Str");
  query.setParameter("String_Node_Str","String_Node_Str");
  List<PersonMongo> results=query.getResultList();
  Assert.assertEquals(3,results.size());
  query=em.createNamedQuery("String_Node_Str");
  query.setParameter(1,"String_Node_Str");
  results=query.getResultList();
  Assert.assertEquals(3,results.size());
  query=em.createQuery("String_Node_Str");
  query.setMaxResults(2);
  results=query.getResultList();
  Assert.assertNotNull(results);
  Assert.assertEquals(2,results.size());
  selectIdQuery();
}

Fixed version (ground truth):
/** 
 * On insert mongo.
 */
@Test public void onInsertMongo() throws Exception {
  Object p1=prepareMongoInstance("String_Node_Str",10);
  Object p2=prepareMongoInstance("String_Node_Str",20);
  Object p3=prepareMongoInstance("String_Node_Str",15);
  Query findQuery=em.createQuery("String_Node_Str");
  List<PersonMongo> allPersons=findQuery.getResultList();
  Assert.assertNotNull(allPersons);
  Assert.assertTrue(allPersons.isEmpty());
  findQuery=em.createQuery("String_Node_Str");
  allPersons=findQuery.getResultList();
  Assert.assertNotNull(allPersons);
  Assert.assertTrue(allPersons.isEmpty());
  findQuery=em.createQuery("String_Node_Str");
  allPersons=findQuery.getResultList();
  Assert.assertNotNull(allPersons);
  Assert.assertTrue(allPersons.isEmpty());
  em.persist(p1);
  em.persist(p2);
  em.persist(p3);
  col.put("String_Node_Str",p1);
  col.put("String_Node_Str",p2);
  col.put("String_Node_Str",p3);
  em.clear();
  PersonMongo p=findById(PersonMongo.class,"String_Node_Str",em);
  Assert.assertNotNull(p);
  Assert.assertEquals(Day.FRIDAY,p.getDay());
  Assert.assertEquals("String_Node_Str",p.getPersonName());
  assertFindByName(em,"String_Node_Str",PersonMongo.class,"String_Node_Str","String_Node_Str");
  assertFindByNameAndAge(em,"String_Node_Str",PersonMongo.class,"String_Node_Str","String_Node_Str","String_Node_Str");
  assertFindByNameAndAgeGTAndLT(em,"String_Node_Str",PersonMongo.class,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  assertFindByNameAndAgeBetween(em,"String_Node_Str",PersonMongo.class,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  assertFindByRange(em,"String_Node_Str",PersonMongo.class,"String_Node_Str","String_Node_Str","String_Node_Str");
  assertFindWithoutWhereClause(em,"String_Node_Str",PersonMongo.class);
  Query query=em.createNamedQuery("String_Node_Str");
  query.setParameter("String_Node_Str","String_Node_Str");
  List<PersonMongo> results=query.getResultList();
  Assert.assertEquals(3,results.size());
  query=em.createNamedQuery("String_Node_Str");
  query.setParameter(1,"String_Node_Str");
  results=query.getResultList();
  Assert.assertEquals(3,results.size());
  query=em.createQuery("String_Node_Str");
  query.setMaxResults(2);
  results=query.getResultList();
  Assert.assertNotNull(results);
  Assert.assertEquals(2,results.size());
  selectIdQuery();
  onExecuteScript();
}