@Test
public void testDeleteLockedFile() throws Exception {

  final File dst = testFolder.newFile("test.tmp");
  final File src = new File(this.getClass().getResource("/dublincore.xml").toURI());
  locked(dst, new Effect.X<File>() {
    @Override
    protected void xrun(File file) throws IOException {
      file.delete();
      FileSupport.copy(src, file);
    }
  });
  assertTrue(dst.isFile());
  assertEquals(src.length(), dst.length());
}