PreSyncProjectCleanUp { public void cleanUp(@NotNull Project project) { for (ProjectCleanUpTask task : myCleanUpTasks) { task.cleanUp(project); } } PreSyncProjectCleanUp(); @VisibleForTesting  PreSyncProjectCleanUp(@NotNull ProjectCleanUpTask... cleanUpTasks); @NotNull static PreSyncProjectCleanUp getInstance(); void cleanUp(@NotNull Project project);  }
@Test public void execute() { ProjectCleanUpTask task1 = mock(ProjectCleanUpTask.class); ProjectCleanUpTask task2 = mock(ProjectCleanUpTask.class); PreSyncProjectCleanUp projectCleanUp = new PreSyncProjectCleanUp(task1, task2); projectCleanUp.cleanUp(myProject); verify(task1).cleanUp(myProject); verify(task2).cleanUp(myProject); }