### Question:
RollOnStartUp extends TriggeringPolicyBase<E> { @Override public boolean isTriggeringEvent(File activeFile, E event) { if (!m_firstTime) { return false; } m_firstTime = false; return activeFile.exists() && activeFile.length() > 0; }  @Override boolean isTriggeringEvent(File activeFile, E event);  }### Answer:
@Test public void testRollOnStartUp() throws IOException { final File f = new File(getDirectory(), "foo"); final FileWriter out = new FileWriter(f); out.write("foo"); out.close(); final RollOnStartUp<Object> r1 = new RollOnStartUp<Object>(); assertTrue(r1.isTriggeringEvent(f, null)); assertFalse(r1.isTriggeringEvent(f, null)); assertFalse(r1.isTriggeringEvent(f, null)); assertTrue(new RollOnStartUp<Object>().isTriggeringEvent(f, null)); assertFalse(r1.isTriggeringEvent(f, null)); }
@Test public void testRollOnStartUpNoFile() throws IOException { final File f = new File(getDirectory(), "foo"); final RollOnStartUp<Object> r1 = new RollOnStartUp<Object>(); assertFalse(r1.isTriggeringEvent(f, null)); }
@Test public void testRollOnStartUpEmptyFile() throws IOException { final File f = new File(getDirectory(), "foo"); f.createNewFile(); final RollOnStartUp<Object> r1 = new RollOnStartUp<Object>(); assertFalse(r1.isTriggeringEvent(f, null)); }