@Test
 public void withExcludeTask() {
   expectedExcludedTasks.add("excluded");
   checkConversion("-x", "excluded");
   expectedExcludedTasks.add("excluded2");
   checkConversion("-x", "excluded", "-x", "excluded2");
 }
    public void afterExecute(Task task, TaskState state) {
      assertThat(task, sameInstance(current));
      current = null;

      String taskPath = path(task);
      if (taskPath.startsWith(":buildSrc:")) {
        return;
      }

      if (state.getSkipped()) {
        skippedTasks.add(taskPath);
      }
    }
 private Set<String> getExecutedTasks() {
   Set<String> notSkipped = new HashSet<String>(plannedTasks);
   notSkipped.removeAll(skippedTasks);
   return notSkipped;
 }