private void testDestroyOnExit(Class<?> starter, boolean fileIsAlwaysCreated) throws Exception {
File file = WriterLoop.getFile();
if (file.exists())
FileUtils.forceDelete(file);
new ProcessExecutor("java", "-cp", SystemUtils.JAVA_CLASS_PATH, starter.getName()).redirectOutputAsInfo().execute();
// After WriterLoopStarter has finished we expect that WriterLoop is also finished - no-one is updating the file
if (fileIsAlwaysCreated || file.exists()) {
checkFileStaysTheSame(file);
FileUtils.forceDelete(file);
}