public static List<File> getFilesByExtension(File dir, String[] extensions)
    {
        if (!dir.isDirectory() || extensions == null)
            return Collections.emptyList();
        List<File> files = new ArrayList<File>();
        addFilesByExtension(files, dir, extensions);
        return files;
    }
Returns a list of file filtered by their file types/extensions; (E.g ".proto")
protostuff-compiler/src/main/java/io/protostuff/compiler/CompilerUtil.java