class PerforceAnnotationParser implements Executor.StreamHandler {

    private static final Logger LOGGER = LoggerFactory.getLogger(PerforceAnnotationParser.class);

    /**
     * Store annotation created by processStream.
     */
    private final Annotation annotation;

    private final PerforceRepository repo;

    private final File file;

    private static final Pattern ANNOTATION_PATTERN = Pattern.compile("^(\\d+): .*");

    /**
     * @param repo defined instance
     * @param file the file being annotated
     */
    public PerforceAnnotationParser(PerforceRepository repo, File file) {
        annotation = new Annotation(file.getName());
        this.repo = repo;
        this.file = file;
    }

    /**
     * Returns the annotation that has been created.
     *
     * @return annotation an annotation object
     */
    public Annotation getAnnotation() {
        return annotation;
    }

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

        // Pass null for revision to get all history for the file.
        PerforceHistoryParser parser = new PerforceHistoryParser(repo);
        List<HistoryEntry> revisions = parser.getRevisions(file, null).getHistoryEntries();
        HashMap<String, String> revAuthor = new HashMap<>();
        for (HistoryEntry entry : revisions) {
            revAuthor.put(entry.getRevision(), entry.getAuthor());
        }

        String line;
        int lineno = 0;
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(input))) {
            while ((line = reader.readLine()) != null) {
                ++lineno;
                if (line.equals("(... files differ ...)")) {
                    // Perforce knows as a binary file?
                    continue;
                }

                Matcher matcher = ANNOTATION_PATTERN.matcher(line);
                if (matcher.find()) {
                    String revision = matcher.group(1);
                    String author = revAuthor.get(revision);
                    annotation.addLine(revision, author, true);
                } else {
                    LOGGER.log(Level.WARNING,
                            "Error: did not find annotation in line {0} for ''{1}'': [{2}]",
                            new Object[]{lineno, this.file, line});
                }
            }
        } catch (IOException e) {
            LOGGER.log(Level.WARNING,
                    String.format("Error: Could not read annotations for '%s'", this.file), e);
        }
    
<no_super_class>