Program: 175984
Project: 175984
Buggy source:
@Test public void executeJPAQueriesTest(){
  persistPerson("String_Node_Str","String_Node_Str",10,new Office(1,"String_Node_Str","String_Node_Str"));
  persistPerson("String_Node_Str","String_Node_Str",20,new Office(2,"String_Node_Str","String_Node_Str"));
  persistPerson("String_Node_Str","String_Node_Str",30,new Office(3,"String_Node_Str","String_Node_Str"));
  persistPerson("String_Node_Str","String_Node_Str",40,new Office(4,"String_Node_Str","String_Node_Str"));
  clearEm();
  String findWithOutWhereClause="String_Node_Str";
  List<PersonEmbeddedKVStore> results=executeSelectQuery(findWithOutWhereClause);
  Assert.assertEquals(4,results.size());
  clearEm();
  String findByName="String_Node_Str";
  Map<Object,Object> params=new HashMap<Object,Object>();
  params.put("String_Node_Str","String_Node_Str");
  results=executeSelectQuery(findByName,params);
  Assert.assertEquals(1,results.size());
  Assert.assertEquals("String_Node_Str",results.get(0).getPersonId());
  Assert.assertEquals("String_Node_Str",results.get(0).getPersonName());
  Assert.assertEquals(10,results.get(0).getAge());
  clearEm();
  String findById="String_Node_Str";
  params=new HashMap<Object,Object>();
  params.put("String_Node_Str","String_Node_Str");
  results=executeSelectQuery(findById,params);
  Assert.assertEquals(1,results.size());
  Assert.assertEquals("String_Node_Str",results.get(0).getPersonId());
  Assert.assertEquals("String_Node_Str",results.get(0).getPersonName());
  Assert.assertEquals(20,results.get(0).getAge());
  clearEm();
  String findByIdAndAge="String_Node_Str";
  params=new HashMap<Object,Object>();
  params.put("String_Node_Str","String_Node_Str");
  params.put("String_Node_Str",30);
  results=executeSelectQuery(findByIdAndAge,params);
  Assert.assertEquals(1,results.size());
  Assert.assertEquals("String_Node_Str",results.get(0).getPersonId());
  Assert.assertEquals("String_Node_Str",results.get(0).getPersonName());
  Assert.assertEquals(30,results.get(0).getAge());
  clearEm();
  params=new HashMap<Object,Object>();
  params.put("String_Node_Str","String_Node_Str");
  params.put("String_Node_Str",30);
  results=executeSelectQuery(findByIdAndAge,params);
  Assert.assertEquals(0,results.size());
  if (!isLuceneIndexingEnabled()) {
    clearEm();
  }
  clearEm();
  String findSelective="String_Node_Str";
  results=executeSelectQuery(findSelective);
  Assert.assertEquals(4,results.size());
  Assert.assertNull(results.get(0).getPersonName());
  Assert.assertNotNull(results.get(0).getAge());
  clearEm();
  String deleteQuery="String_Node_Str";
  int updateCount=executeDMLQuery(deleteQuery);
  Assert.assertEquals(4,updateCount);
  clearEm();
  Assert.assertEquals(null,findById("String_Node_Str"));
  Assert.assertEquals(null,findById("String_Node_Str"));
  Assert.assertEquals(null,findById("String_Node_Str"));
  Assert.assertEquals(null,findById("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void executeJPAQueriesTest(){
  persistPerson("String_Node_Str","String_Node_Str",10,new Office(1,"String_Node_Str","String_Node_Str"));
  persistPerson("String_Node_Str","String_Node_Str",20,new Office(2,"String_Node_Str","String_Node_Str"));
  persistPerson("String_Node_Str","String_Node_Str",30,new Office(3,"String_Node_Str","String_Node_Str"));
  persistPerson("String_Node_Str","String_Node_Str",40,new Office(4,"String_Node_Str","String_Node_Str"));
  clearEm();
  String findWithOutWhereClause="String_Node_Str";
  List<PersonEmbeddedKVStore> results=executeSelectQuery(findWithOutWhereClause);
  Assert.assertEquals(4,results.size());
  clearEm();
  String findByName="String_Node_Str";
  Map<Object,Object> params=new HashMap<Object,Object>();
  params.put("String_Node_Str","String_Node_Str");
  results=executeSelectQuery(findByName,params);
  Assert.assertEquals(1,results.size());
  Assert.assertEquals("String_Node_Str",results.get(0).getPersonId());
  Assert.assertEquals("String_Node_Str",results.get(0).getPersonName());
  Assert.assertEquals(10,results.get(0).getAge());
  clearEm();
  String findById="String_Node_Str";
  params=new HashMap<Object,Object>();
  params.put("String_Node_Str","String_Node_Str");
  results=executeSelectQuery(findById,params);
  Assert.assertEquals(1,results.size());
  Assert.assertEquals("String_Node_Str",results.get(0).getPersonId());
  Assert.assertEquals("String_Node_Str",results.get(0).getPersonName());
  Assert.assertEquals(20,results.get(0).getAge());
  clearEm();
  String findByIdAndAge="String_Node_Str";
  params=new HashMap<Object,Object>();
  params.put("String_Node_Str","String_Node_Str");
  params.put("String_Node_Str",30);
  results=executeSelectQuery(findByIdAndAge,params);
  Assert.assertEquals(1,results.size());
  Assert.assertEquals("String_Node_Str",results.get(0).getPersonId());
  Assert.assertEquals("String_Node_Str",results.get(0).getPersonName());
  Assert.assertEquals(30,results.get(0).getAge());
  clearEm();
  params=new HashMap<Object,Object>();
  params.put("String_Node_Str","String_Node_Str");
  params.put("String_Node_Str",30);
  results=executeSelectQuery(findByIdAndAge,params);
  Assert.assertEquals(0,results.size());
  if (!isLuceneIndexingEnabled()) {
    clearEm();
  }
  clearEm();
  String findSelective="String_Node_Str";
  results=executeSelectQuery(findSelective);
  Assert.assertEquals(4,results.size());
  Assert.assertNull(results.get(0).getPersonName());
  Assert.assertNotNull(results.get(0).getAge());
  clearEm();
  String findByCompanyName="String_Node_Str";
  params=new HashMap<Object,Object>();
  params.put("String_Node_Str","String_Node_Str");
  results=executeSelectQuery(findByCompanyName,params);
  Assert.assertEquals(1,results.size());
  Assert.assertEquals("String_Node_Str",results.get(0).getPersonId());
  Assert.assertEquals("String_Node_Str",results.get(0).getPersonName());
  Assert.assertEquals(30,results.get(0).getAge());
  Assert.assertEquals(3,results.get(0).getOffice().getOfficeId());
  Assert.assertEquals("String_Node_Str",results.get(0).getOffice().getCompanyName());
  Assert.assertEquals("String_Node_Str",results.get(0).getOffice().getLocation());
  String deleteQuery="String_Node_Str";
  int updateCount=executeDMLQuery(deleteQuery);
  Assert.assertEquals(4,updateCount);
  clearEm();
  Assert.assertEquals(null,findById("String_Node_Str"));
  Assert.assertEquals(null,findById("String_Node_Str"));
  Assert.assertEquals(null,findById("String_Node_Str"));
  Assert.assertEquals(null,findById("String_Node_Str"));
}