Program: 90017
Project: 90017
Buggy source:
public void testCacheData() throws Exception {
  final Map<Integer,File> combined=new HashMap<Integer,File>();
  final Set<Integer> rawgotten=new HashSet<Integer>();
  CombiningMultiFileBasedCache<Integer> cache=new CombiningMultiFileBasedCache<Integer>("String_Node_Str",new FileBasedCache<Integer>("String_Node_Str"){
    public File getCacheFile(    Integer id){
      return new File(TestInfo.CRAWLLOGS_DIR,"String_Node_Str" + id + "String_Node_Str");
    }
    public Integer cache(    Integer id){
      rawgotten.add(id);
      return super.cache(id);
    }
    protected Integer cacheData(    Integer id){
      return null;
    }
  }
){
    protected void combine(    Map<Integer,File> filesFound,    Set<Integer> requiredSet){
      File resultFile=getCacheFile(filesFound.keySet());
      combined.clear();
      combined.putAll(filesFound);
      try {
        resultFile.createNewFile();
      }
 catch (      IOException e) {
        throw new IOFailure("String_Node_Str",e);
      }
    }
  }
;
  Set<Integer> ids=new HashSet<Integer>();
  ids.add(1);
  ids.add(4);
  checkContainsExactly("String_Node_Str",list(1,4),cache.cache(ids));
  checkContainsExactly("String_Node_Str",list(1,4),combined.keySet());
  combined.clear();
  checkContainsExactly("String_Node_Str",list(1,4),cache.cache(ids));
  assertTrue("String_Node_Str",combined.isEmpty());
  ids.remove(4);
  ids.add(5);
  rawgotten.clear();
  checkContainsExactly("String_Node_Str",list(1),cache.cache(ids));
  checkContainsExactly("String_Node_Str",list(1,5),rawgotten);
  assertEquals("String_Node_Str",0,combined.size());
}

Fixed version (ground truth):
public void testCacheData() throws Exception {
  final Map<Integer,File> combined=new HashMap<Integer,File>();
  final Set<Integer> rawgotten=new HashSet<Integer>();
  CombiningMultiFileBasedCache<Integer> cache=new CombiningMultiFileBasedCache<Integer>("String_Node_Str",new FileBasedCache<Integer>("String_Node_Str"){
    public File getCacheFile(    Integer id){
      return new File(TestInfo.CRAWLLOGS_DIR,"String_Node_Str" + id + "String_Node_Str");
    }
    public Integer cache(    Integer id){
      rawgotten.add(id);
      return super.cache(id);
    }
    protected Integer cacheData(    Integer id){
      return null;
    }
  }
){
    protected void combine(    Map<Integer,File> filesFound){
      File resultFile=getCacheFile(filesFound.keySet());
      combined.clear();
      combined.putAll(filesFound);
      try {
        resultFile.createNewFile();
      }
 catch (      IOException e) {
        throw new IOFailure("String_Node_Str",e);
      }
    }
  }
;
  Set<Integer> ids=new HashSet<Integer>();
  ids.add(1);
  ids.add(4);
  checkContainsExactly("String_Node_Str",list(1,4),cache.cache(ids));
  checkContainsExactly("String_Node_Str",list(1,4),combined.keySet());
  combined.clear();
  checkContainsExactly("String_Node_Str",list(1,4),cache.cache(ids));
  assertTrue("String_Node_Str",combined.isEmpty());
  ids.remove(4);
  ids.add(5);
  rawgotten.clear();
  checkContainsExactly("String_Node_Str",list(1),cache.cache(ids));
  checkContainsExactly("String_Node_Str",list(1,5),rawgotten);
  assertEquals("String_Node_Str",0,combined.size());
}