@Test
public void testFlag() {

    final SparkListenerJobEnd event = new SparkListenerJobEnd(1, 0, JobSucceeded$.MODULE$);
    apply(false, event);
    Assert.assertTrue("Expected file to exist", tempFile.exists());
}