Program: 132475
Project: 132475
Buggy source:
public void testOverlayStringTree(){
  MultiOverlayStringTree<String> tree=new MultiOverlayStringTree<String>("String_Node_Str");
  final int numElements=200;
  tree=new MultiOverlayStringTree<String>("String_Node_Str");
  final SortedMap<String,String> map1=new TreeMap<String,String>();
  for (int i=0x10; i < numElements; i++) {
    String key=Integer.toHexString(i);
    String val=Integer.toHexString((int)(Math.random() * Integer.MAX_VALUE));
    map1.put(key,val);
    tree.insert(key,val);
  }
  int snap1=tree.newOverlay();
  final SortedMap<String,String> map2=new TreeMap<String,String>(map1);
  for (int i=0x10; i < numElements; i+=2) {
    String key=Integer.toHexString(i);
    tree.insert(key,null);
    map2.remove(key);
  }
  int snap2=tree.newOverlay();
  final SortedMap<String,String> map3=new TreeMap<String,String>(map2);
  for (int i=0x10; i < numElements; i+=5) {
    String key=Integer.toHexString(i);
    String val=Integer.toHexString((int)(Math.random() * Integer.MAX_VALUE));
    tree.insert(key,val);
    map3.put(key,val);
  }
  Iterator<Entry<String,String>> it=tree.prefixLookup(null);
  Iterator<String> itExpected=map3.values().iterator();
  while (it.hasNext())   assertEquals(itExpected.next(),it.next().getValue());
  assertFalse(itExpected.hasNext());
  it=tree.prefixLookup(null,snap1);
  itExpected=map1.values().iterator();
  while (it.hasNext())   assertEquals(itExpected.next(),it.next().getValue());
  assertFalse(itExpected.hasNext());
  it=tree.prefixLookup(null,snap2);
  itExpected=map2.values().iterator();
  while (it.hasNext())   assertEquals(itExpected.next(),it.next().getValue());
  assertFalse(itExpected.hasNext());
  it=tree.prefixLookup("String_Node_Str");
  itExpected=map3.subMap("String_Node_Str","String_Node_Str").values().iterator();
  while (it.hasNext())   assertEquals(itExpected.next(),it.next().getValue());
  assertFalse(itExpected.hasNext());
}

Fixed version (ground truth):
public void testOverlayStringTree(){
  MultiOverlayStringTree<String> tree=new MultiOverlayStringTree<String>("String_Node_Str");
  final int numElements=200;
  tree=new MultiOverlayStringTree<String>("String_Node_Str");
  final SortedMap<String,String> map1=new TreeMap<String,String>();
  for (int i=0x10; i < numElements; i++) {
    String key=Integer.toHexString(i);
    String val=Integer.toHexString((int)(Math.random() * Integer.MAX_VALUE));
    map1.put(key,val);
    tree.insert(key,val);
  }
  int snap1=tree.newOverlay();
  final SortedMap<String,String> map2=new TreeMap<String,String>(map1);
  for (int i=0x10; i < numElements; i+=2) {
    String key=Integer.toHexString(i);
    tree.insert(key,null);
    map2.remove(key);
  }
  int snap2=tree.newOverlay();
  final SortedMap<String,String> map3=new TreeMap<String,String>(map2);
  for (int i=0x10; i < numElements; i+=5) {
    String key=Integer.toHexString(i);
    String val=Integer.toHexString((int)(Math.random() * Integer.MAX_VALUE));
    tree.insert(key,val);
    map3.put(key,val);
  }
  Iterator<Entry<String,String>> it=tree.prefixLookup(null,false);
  Iterator<String> itExpected=map3.values().iterator();
  while (it.hasNext())   assertEquals(itExpected.next(),it.next().getValue());
  assertFalse(itExpected.hasNext());
  it=tree.prefixLookup(null,snap1,false);
  itExpected=map1.values().iterator();
  while (it.hasNext())   assertEquals(itExpected.next(),it.next().getValue());
  assertFalse(itExpected.hasNext());
  it=tree.prefixLookup(null,snap2,false);
  itExpected=map2.values().iterator();
  while (it.hasNext())   assertEquals(itExpected.next(),it.next().getValue());
  assertFalse(itExpected.hasNext());
  it=tree.prefixLookup("String_Node_Str",false);
  itExpected=map3.subMap("String_Node_Str","String_Node_Str").values().iterator();
  while (it.hasNext())   assertEquals(itExpected.next(),it.next().getValue());
  assertFalse(itExpected.hasNext());
}