### Question:
CleanupTask extends BukkitRunnable { @Override public void run() { hasCleanupStore.retrieveAllOfType() .forEach(HasCleanup::performCleanup); } CleanupTask(); @Override void run();  }### Answer:
@Test public void shouldPerformCleanup() { List<HasCleanup> services = asList(mock(HasCleanup.class), mock(HasCleanup.class), mock(HasCleanup.class)); given(hasCleanupStore.retrieveAllOfType()).willReturn(services); cleanupTask.run(); verify(services.get(0)).performCleanup(); verify(services.get(1)).performCleanup(); verify(services.get(2)).performCleanup(); }