class Analyzer {

    protected Set<File> getFiles(File file, Set<File> files) {
        if (file.isFile()) {
            files.add(file);
        } else if (file.isDirectory()) {
            File[] filesInFolder = file.listFiles();

            for (File fileInFolder : filesInFolder) {
                getFiles(fileInFolder, files);
            }
        }

        return files;
    }

}