class Analyzer {

    protected Map<String, List<MarkerPair>> analyzeFiles(List<File> rootFiles) {

        Set<File> files = new HashSet<>();

        /* create a list of all files */
        for (File rootFile : rootFiles) {
            Set<File> filesUnderRoot = getFiles(rootFile, new HashSet<>());
            files.addAll(filesUnderRoot);
        }

        /* process files */
        Map<String, List<MarkerPair>> result = new HashMap<>();
        for (File file : files) {
            try {
                LOG.debug("Analyzing: {}", file.getPath());

                List<MarkerPair> markerPairs = fileProcessor.processFile(file);

                // only add a file with findings
                if (!markerPairs.isEmpty()) {
                    result.put(file.getPath(), markerPairs);
                }

            } catch (FileNotFoundException e) {
                LOG.error("File not found:{}", file.getAbsolutePath(), e);
            } catch (IOException e) {
                LOG.error("Was not able to process file:{}", file.getAbsolutePath(), e);
            }
        }

        return result;
    }

}