Program: 104886
Project: 104886
Buggy source:
@Test public void testSaveAndDelete() throws Exception {
  Rectangle rect=new Rectangle(10,10);
  rect.setId("String_Node_Str");
  ds.save(rect);
  assertEquals(1,ds.getCount(rect));
  ds.delete(rect);
  assertEquals(0,ds.getCount(rect));
  ds.save(rect);
  assertEquals(1,ds.getCount(rect));
  ds.delete(rect.getClass(),1);
  assertEquals(1,ds.getCount(rect));
  ds.delete(rect.getClass(),"String_Node_Str");
  assertEquals(0,ds.getCount(rect));
  ds.save(rect);
  assertEquals(1,ds.getCount(rect));
  List<String> ids=new ArrayList<String>();
  ids.add("String_Node_Str");
  ds.delete(rect.getClass(),ids);
  assertEquals(0,ds.getCount(rect));
  rect.setId("String_Node_Str");
  ds.save(rect);
  rect.setId("String_Node_Str");
  ds.save(rect);
  assertEquals(2,ds.getCount(rect));
  ids.clear();
  ids.add("String_Node_Str");
  ids.add("String_Node_Str");
  ds.delete(rect.getClass(),ids);
  assertEquals(0,ds.getCount(rect));
  rect.setId("String_Node_Str");
  ds.save(rect);
  rect.setId("String_Node_Str");
  ds.save(rect);
  assertEquals(2,ds.getCount(rect));
  ids.clear();
  ids.add("String_Node_Str");
  ds.delete(rect.getClass(),ids);
  assertEquals(1,ds.getCount(rect));
  rect.setId("String_Node_Str");
  ds.save(rect);
  rect.setId("String_Node_Str");
  ds.save(rect);
  assertEquals(2,ds.getCount(rect));
  ids.clear();
  ids.add("String_Node_Str");
  ds.delete(Rectangle.class,ids);
  assertEquals(1,ds.getCount(rect));
}

Fixed version (ground truth):
@Test public void testSaveAndDelete() throws Exception {
  Rectangle rect=new Rectangle(10,10);
  rect.setId("String_Node_Str");
  ds.save(rect);
  assertEquals(1,ds.getCount(rect));
  ds.delete(rect);
  assertEquals(0,ds.getCount(rect));
  ds.save(rect);
  assertEquals(1,ds.getCount(rect));
  ds.delete(rect.getClass(),1);
  assertEquals(1,ds.getCount(rect));
  ds.delete(rect.getClass(),"String_Node_Str");
  assertEquals(0,ds.getCount(rect));
  ds.save(rect);
  assertEquals(1,ds.getCount(rect));
  List<String> ids=new ArrayList<String>();
  ids.add("String_Node_Str");
  ds.delete(rect.getClass(),ids);
  assertEquals(0,ds.getCount(rect));
  rect.setId("String_Node_Str");
  ds.save(rect);
  rect.setId("String_Node_Str");
  ds.save(rect);
  assertEquals(2,ds.getCount(rect));
  ids.clear();
  ids.add("String_Node_Str");
  ids.add("String_Node_Str");
  ds.delete(rect.getClass(),ids);
  assertEquals(0,ds.getCount(rect));
  ids.clear();
  rect.setId(null);
  ds.save(rect);
  ids.add(rect.getId());
  rect.setId(null);
  ds.save(rect);
  ids.add(rect.getId());
  assertEquals("String_Node_Str",2,ds.getCount(rect));
  ds.delete(rect.getClass(),ids);
  assertEquals("String_Node_Str",0,ds.getCount(rect));
  rect.setId("String_Node_Str");
  ds.save(rect);
  rect.setId("String_Node_Str");
  ds.save(rect);
  assertEquals(2,ds.getCount(rect));
  ids.clear();
  ids.add("String_Node_Str");
  ds.delete(rect.getClass(),ids);
  assertEquals(1,ds.getCount(rect));
  rect.setId("String_Node_Str");
  ds.save(rect);
  rect.setId("String_Node_Str");
  ds.save(rect);
  assertEquals(2,ds.getCount(rect));
  ids.clear();
  ids.add("String_Node_Str");
  ds.delete(Rectangle.class,ids);
  assertEquals(1,ds.getCount(rect));
}