Program: 132305
Project: 132305
Buggy source:
@Test public void testMultipleIndicesAndCheckpoint() throws Exception {
  database=BabuDBFactory.createBabuDB(new BabuDBConfig(baseDir,baseDir,1,0,0,SyncMode.SYNC_WRITE,0,0,compression,maxNumRecs,maxBlockFileSize));
  Database db=database.getDatabaseManager().createDatabase("String_Node_Str",4);
  DatabaseInsertGroup ir=db.createInsertGroup();
  ir.addInsert(0,"String_Node_Str".getBytes(),"String_Node_Str".getBytes());
  ir.addInsert(1,"String_Node_Str".getBytes(),"String_Node_Str".getBytes());
  ir.addInsert(2,"String_Node_Str".getBytes(),"String_Node_Str".getBytes());
  db.insert(ir,null).get();
  database.getCheckpointer().checkpoint();
  byte[] result=db.lookup(0,"String_Node_Str".getBytes(),null).get();
  assertNotNull(result);
  String value=new String(result);
  assertEquals(value,"String_Node_Str");
  result=db.lookup(1,"String_Node_Str".getBytes(),null).get();
  assertEquals("String_Node_Str",new String(result));
  result=db.lookup(2,"String_Node_Str".getBytes(),null).get();
  assertEquals("String_Node_Str",new String(result));
  Iterator<Entry<byte[],byte[]>> iter=db.prefixLookup(3,"String_Node_Str".getBytes(),null).get();
  assertFalse(iter.hasNext());
  ir=db.createInsertGroup();
  ir.addDelete(0,"String_Node_Str".getBytes());
  ir.addInsert(1,"String_Node_Str".getBytes(),"String_Node_Str".getBytes());
  ir.addInsert(2,"String_Node_Str".getBytes(),"String_Node_Str".getBytes());
  db.insert(ir,null).get();
  database.getCheckpointer().checkpoint();
  iter=db.prefixLookup(2,"String_Node_Str".getBytes(),null).get();
  assertTrue(iter.hasNext());
  Entry<byte[],byte[]> next=iter.next();
  assertEquals("String_Node_Str",new String(next.getKey()));
  assertEquals("String_Node_Str",new String(next.getValue()));
  assertTrue(!iter.hasNext());
  System.out.println("String_Node_Str");
  database.shutdown();
}

Fixed version (ground truth):
@Test public void testMultipleIndicesAndCheckpoint() throws Exception {
  database=BabuDBFactory.createBabuDB(new BabuDBConfig(baseDir,baseDir,1,0,0,SyncMode.SYNC_WRITE,0,0,compression,maxNumRecs,maxBlockFileSize,true,0,Logging.LEVEL_DEBUG));
  Database db=database.getDatabaseManager().createDatabase("String_Node_Str",4);
  DatabaseInsertGroup ir=db.createInsertGroup();
  ir.addInsert(0,"String_Node_Str".getBytes(),"String_Node_Str".getBytes());
  ir.addInsert(1,"String_Node_Str".getBytes(),"String_Node_Str".getBytes());
  ir.addInsert(2,"String_Node_Str".getBytes(),"String_Node_Str".getBytes());
  db.insert(ir,null).get();
  database.getCheckpointer().checkpoint();
  byte[] result=db.lookup(0,"String_Node_Str".getBytes(),null).get();
  assertNotNull(result);
  String value=new String(result);
  assertEquals(value,"String_Node_Str");
  result=db.lookup(1,"String_Node_Str".getBytes(),null).get();
  assertEquals("String_Node_Str",new String(result));
  result=db.lookup(2,"String_Node_Str".getBytes(),null).get();
  assertEquals("String_Node_Str",new String(result));
  Iterator<Entry<byte[],byte[]>> iter=db.prefixLookup(3,"String_Node_Str".getBytes(),null).get();
  assertFalse(iter.hasNext());
  ir=db.createInsertGroup();
  ir.addDelete(0,"String_Node_Str".getBytes());
  ir.addInsert(1,"String_Node_Str".getBytes(),"String_Node_Str".getBytes());
  ir.addInsert(2,"String_Node_Str".getBytes(),"String_Node_Str".getBytes());
  db.insert(ir,null).get();
  database.getCheckpointer().checkpoint();
  iter=db.prefixLookup(2,"String_Node_Str".getBytes(),null).get();
  assertTrue(iter.hasNext());
  Entry<byte[],byte[]> next=iter.next();
  assertEquals("String_Node_Str",new String(next.getKey()));
  assertEquals("String_Node_Str",new String(next.getValue()));
  assertTrue(!iter.hasNext());
  System.out.println("String_Node_Str");
  database.shutdown();
}