code: public Collection<Task> scan(final Reader reader) throws IOException {
          try {
              if (isInvalidPattern) {
                  throw new AbortException(errorMessage.toString());
              }
              LineIterator lineIterator = IOUtils.lineIterator(reader);
              List<Task> tasks = new ArrayList<Task>();
              for (int lineNumber = 1; lineIterator.hasNext(); lineNumber++) {
                  String line = (String)lineIterator.next();
  
                  for (Priority priority : Priority.values()) {
                      if (patterns.containsKey(priority)) {
                          Matcher matcher = patterns.get(priority).matcher(line);
                          if (matcher.matches() && matcher.groupCount() == 2) {
                              String message = matcher.group(2).trim();
                              tasks.add(new Task(priority, lineNumber, matcher.group(1), StringUtils.remove(message, ":").trim()));
                          }
                      }
                  }
              }
  
              return tasks;
          }
          finally {
              reader.close();
          }
      }
docs: Scans the specified input stream for open tasks.
  
  @param reader
  the file to scan
  @return the result stored as java project
  @throws IOException
  if we can't read the file