### Question:
OpenAllDownloadedExercisesTask extends SimpleBackgroundTask<Exercise> { @Override public void run(Exercise exercise) { if (canOpen(exercise)) { opener.open(exercise); exercise.getProject().setStatus(ProjectStatus.DOWNLOADED); } } OpenAllDownloadedExercisesTask(String description, List<Exercise> list, ProjectOpener opener, IOFactory io); @Override void run(Exercise exercise);  }### Answer:
@Test public void opensProjectsWithKnownBuildfile() throws IOException { FakeFileIO pom = io.getFake("/project/pom.xml"); List<String> p1Files = new ArrayList<String>(); p1Files.add(pom.getPath()); p1.setProjectFiles(p1Files); task.run(e1); verify(opener, times(1)).open(any(Exercise.class)); }
@Test public void doesNotOpenProjectsWithoutKnownbuildfiles() { task.run(e1); verify(opener, times(0)).open(e1); }
@Test public void doesNotOpenProjectswithfilesButWithoutKnownbuildfiles() { p1.addProjectFile("a"); task.run(e1); verify(opener, times(0)).open(e1); }