Program: 28800
Project: 28800
Buggy source:
@Test public void simplePermanentTransferAndRemovalTest() throws Exception {
  final String FILE_A_PREFIX="String_Node_Str";
  final String FILE_A_NAME="String_Node_Str";
  final String FILE_B_PREFIX="String_Node_Str";
  final String FILE_B_NAME="String_Node_Str";
  final String FILE_C_PREFIX=FILE_B_PREFIX;
  final String FILE_C_NAME="String_Node_Str";
  final Set<File> desiredPresent=new HashSet<File>();
  final Set<File> desiredAbsent=new HashSet<File>();
  final File origDir=File.createTempFile("String_Node_Str","String_Node_Str");
  origDir.delete();
  File targetDir=null;
  try {
    targetDir=File.createTempFile("String_Node_Str","String_Node_Str");
    targetDir.delete();
    targetDir.mkdir();
    origDir.mkdir();
    final File fileA=new File(origDir,FILE_A_NAME);
    writeFile(fileA,"String_Node_Str","String_Node_Str");
    desiredPresent.add(new File(targetDir.toURI().resolve(FILE_A_PREFIX + FILE_A_NAME)));
    final File fileB=new File(origDir,FILE_B_NAME);
    desiredAbsent.add(new File(targetDir.toURI().resolve(FILE_B_PREFIX + FILE_B_NAME)));
    writeFile(fileB,"String_Node_Str","String_Node_Str","String_Node_Str");
    final File fileC=new File(origDir,FILE_C_NAME);
    desiredPresent.add(new File(targetDir.toURI().resolve(FILE_C_PREFIX + FILE_C_NAME)));
    writeFile(fileC,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
    new CommonPermTest(){
      @Override protected CommonPermTest init(      File targetDir){
        super.init(targetDir);
        return this;
      }
      @Override protected void addParts(      Outbound ob,      PayloadFilesManager instance) throws Exception {
        ob.attachFile("String_Node_Str",URI.create(FILE_A_PREFIX + fileA.getName()),"String_Node_Str",fileA);
        ob.attachFile("String_Node_Str",URI.create(FILE_B_PREFIX + fileB.getName()),"String_Node_Str",fileB);
        ob.attachFile("String_Node_Str",URI.create(FILE_C_PREFIX + fileC.getName()),"String_Node_Str",fileC);
      }
      @Override protected void checkResults(      Inbound ib,      PayloadFilesManager instance) throws Exception {
        instance.processParts(ib);
        Payload.Outbound ob=PayloadImpl.Outbound.newInstance();
        ob.requestFileRemoval(URI.create(FILE_B_PREFIX + FILE_B_NAME),"String_Node_Str",null);
        final ByteArrayOutputStream baos=new ByteArrayOutputStream();
        ob.writeTo(baos);
        baos.close();
        final PayloadFilesManager remover=new PayloadFilesManager.Perm(instance.getTargetDir(),null,Logger.getAnonymousLogger());
        final ByteArrayInputStream bais=new ByteArrayInputStream(baos.toByteArray());
        Payload.Inbound removerIB=PayloadImpl.Inbound.newInstance("String_Node_Str",bais);
        remover.processParts(removerIB);
        final Set<File> missing=new HashSet<File>();
        for (        File f : desiredPresent) {
          if (!f.exists()) {
            missing.add(f);
          }
        }
        assertEquals("String_Node_Str",Collections.EMPTY_SET,missing);
        final Set<File> unexpectedlyPresent=new HashSet<File>();
        for (        File f : desiredAbsent) {
          if (f.exists()) {
            unexpectedlyPresent.add(f);
          }
        }
        assertEquals("String_Node_Str",Collections.EMPTY_SET,unexpectedlyPresent);
      }
      @Override protected void cleanup(){
        for (        File f : desiredPresent) {
          f.delete();
        }
      }
    }
.init(targetDir).run("String_Node_Str");
  }
  finally {
    if (targetDir != null) {
      FileUtils.whack(targetDir);
    }
  }
}

Fixed version (ground truth):
@Test public void simplePermanentTransferAndRemovalTest() throws Exception {
  final String FILE_A_PREFIX="String_Node_Str";
  final String FILE_A_NAME="String_Node_Str";
  final String FILE_B_PREFIX="String_Node_Str";
  final String FILE_B_NAME="String_Node_Str";
  final String FILE_C_PREFIX=FILE_B_PREFIX;
  final String FILE_C_NAME="String_Node_Str";
  final Set<File> desiredPresent=new HashSet<File>();
  final Set<File> desiredAbsent=new HashSet<File>();
  final File origDir=File.createTempFile("String_Node_Str","String_Node_Str");
  origDir.delete();
  File targetDir=null;
  try {
    targetDir=File.createTempFile("String_Node_Str","String_Node_Str");
    targetDir.delete();
    targetDir.mkdir();
    origDir.mkdir();
    final File fileA=new File(origDir,FILE_A_NAME);
    writeFile(fileA,"String_Node_Str","String_Node_Str");
    desiredPresent.add(new File(targetDir.toURI().resolve(FILE_A_PREFIX + FILE_A_NAME)));
    final File fileB=new File(origDir,FILE_B_NAME);
    desiredAbsent.add(new File(targetDir.toURI().resolve(FILE_B_PREFIX + FILE_B_NAME)));
    writeFile(fileB,"String_Node_Str","String_Node_Str","String_Node_Str");
    final File fileC=new File(origDir,FILE_C_NAME);
    desiredPresent.add(new File(targetDir.toURI().resolve(FILE_C_PREFIX + FILE_C_NAME)));
    writeFile(fileC,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
    new CommonPermTest(){
      @Override protected CommonPermTest init(      File targetDir){
        super.init(targetDir);
        return this;
      }
      @Override protected void addParts(      Outbound ob,      PayloadFilesManager instance) throws Exception {
        ob.attachFile("String_Node_Str",URI.create(FILE_A_PREFIX + fileA.getName()),"String_Node_Str",fileA);
        ob.attachFile("String_Node_Str",URI.create(FILE_B_PREFIX + fileB.getName()),"String_Node_Str",fileB);
        ob.attachFile("String_Node_Str",URI.create(FILE_C_PREFIX + fileC.getName()),"String_Node_Str",fileC);
      }
      @Override protected void checkResults(      Inbound ib,      PayloadFilesManager instance) throws Exception {
        instance.processParts(ib);
        Payload.Outbound ob=PayloadImpl.Outbound.newInstance();
        ob.requestFileRemoval(URI.create(FILE_B_PREFIX + FILE_B_NAME),"String_Node_Str",null);
        final ByteArrayOutputStream baos=new ByteArrayOutputStream();
        ob.writeTo(baos);
        baos.close();
        final PayloadFilesManager remover=new PayloadFilesManager.Perm(instance.getTargetDir(),null,Logger.getAnonymousLogger());
        final ByteArrayInputStream bais=new ByteArrayInputStream(baos.toByteArray());
        Payload.Inbound removerIB=PayloadImpl.Inbound.newInstance("String_Node_Str",bais);
        remover.processParts(removerIB);
        final Set<File> missing=new HashSet<File>();
        for (        File f : desiredPresent) {
          if (!f.exists()) {
            missing.add(f);
          }
        }
        assertEquals("String_Node_Str",Collections.EMPTY_SET,missing);
        final Set<File> unexpectedlyPresent=new HashSet<File>();
        for (        File f : desiredAbsent) {
          if (f.exists()) {
            unexpectedlyPresent.add(f);
          }
        }
        assertEquals("String_Node_Str",Collections.EMPTY_SET,unexpectedlyPresent);
      }
      @Override protected void cleanup(){
        for (        File f : desiredPresent) {
          f.delete();
        }
        PayloadFilesManagerTest.cleanup(origDir);
      }
    }
.init(targetDir).run("String_Node_Str");
  }
  finally {
    if (targetDir != null) {
      FileUtils.whack(targetDir);
    }
  }
}