class MercurialAnnotationParser implements Executor.StreamHandler {
    private static final Logger LOGGER = LoggerFactory.getLogger(MercurialAnnotationParser.class);

    private Annotation annotation = null;
    private final HashMap<String, HistoryEntry> revs;
    private final File file;

    /**
     * Pattern used to extract author/revision from the {@code hg annotate} command.
     */
    private static final Pattern ANNOTATION_PATTERN = Pattern.compile("^\\s*(\\d+):");

    MercurialAnnotationParser(File file, HashMap<String, HistoryEntry> revs) {
        this.file = file;
        this.revs = revs;
    }

    @Override
    public void processStream(InputStream input) throws IOException {<FILL_FUNCTION_BODY>}

    Annotation getAnnotation() {
        return this.annotation;
    }
}

        annotation = new Annotation(file.getName());
        String line;
        int lineno = 0;
        Matcher matcher = ANNOTATION_PATTERN.matcher("");

        try (BufferedReader in = new BufferedReader(new InputStreamReader(input))) {
            while ((line = in.readLine()) != null) {
                ++lineno;
                matcher.reset(line);
                if (matcher.find()) {
                    String rev = matcher.group(1);
                    String author = "N/A";
                    // Use the history index hash map to get the author.
                    if (revs.get(rev) != null) {
                        author = revs.get(rev).getAuthor();
                    }
                    annotation.addLine(rev, Util.getEmail(author.trim()), true);
                } else {
                    LOGGER.log(Level.WARNING,
                            "Error: did not find annotation in line {0} for ''{1}'': [{2}]",
                            new Object[]{lineno, this.file, line});
                }
            }
        }
    
<no_super_class>