class PackageScanner {

    public static Set<String> scan(File sourceDirectory) {
        Set<String> packages = new HashSet<String>();
        File[] directories = sourceDirectory.listFiles(new FileFilter() {
            @Override
            public boolean accept(File f) {
                return f != null && f.isDirectory();
            }
        });
        if (directories != null) {
            for (File dir : directories) {
                scanPackageInner(dir, null, packages);
            }
        }
        return packages;
    }

}