FileDeleter { public boolean converge(TaskContext context) { boolean deleted = uncheck(() -> Files.deleteIfExists(path)); if (deleted) { context.recordSystemModification(logger, "Deleted file or directory " + path); } return deleted; } FileDeleter(Path path); boolean converge(TaskContext context);  }
@Test public void deleteExisting() { assertFalse(deleter.converge(context)); path.createParents().writeUtf8File("bar"); assertTrue(deleter.converge(context)); assertFalse(deleter.converge(context)); }