### Question:
LaunchBasedTriggeringPolicy extends TriggeringPolicyBase<E> { @Override public boolean isTriggeringEvent(File activeFile, E event) { return shouldTrigger.get() && shouldTrigger.getAndSet(false); }  @Override boolean isTriggeringEvent(File activeFile, E event);  }### Answer:
@Test public void testTriggerOnceAndNeverAgain() { LaunchBasedTriggeringPolicy<Object> policy = new LaunchBasedTriggeringPolicy<>(); File activeFile = Mockito.mock(File.class); Object event = Mockito.mock(Object.class); boolean triggered = policy.isTriggeringEvent(activeFile, event); Assertions.assertTrue(triggered); triggered = policy.isTriggeringEvent(activeFile, event); Assertions.assertFalse(triggered); triggered = policy.isTriggeringEvent(activeFile, event); Assertions.assertFalse(triggered); Mockito.verifyZeroInteractions(activeFile); Mockito.verifyZeroInteractions(event); }