private static void findPkgsInPath(String classPath, String pkgName, HashSet<String> pkgNames) {

        // make sure the classPath is complete
        File cfile = new File(classPath);
        String absolutePath = cfile.getAbsolutePath();
        if (!classPath.equals(absolutePath)) {
            classPath = absolutePath;
        }
        if (!classPath.endsWith(File.separator)) {
            // append the separator so the substring works correctly
            // below when we build the class name to pass to the loader...
            classPath = classPath + File.separator;
        }
        String pkgPath = pkgName != null ? pkgName.replace('.', File.separatorChar) : "";
        classPath += pkgPath;
        
        String pkgPrefix = pkgName;
        if (pkgName != null && pkgName.length() > 0) {
        		pkgPrefix += '.';
        }

        File dir = new File(classPath);
        String[] names = dir.list();
        
        if (names == null) {
            return; // not a directory
        }

        for (String name : names) {
            File f = new File(dir, name);
            if (f.isDirectory()) {
				String subPkgName = pkgPrefix + f.getName();
	            if (!pkgNames.contains(subPkgName)) {
	            	pkgNames.add(subPkgName);
	            }
            }
        }
    }
Find and add to pkgNames, all packages contained within the specified package
@param classPath directory path that is from CLASSPATH
@param pkgName name of package
@param searchClass base or interface class to search for.
@param classNames set of unique class names
Ghidra/Framework/Generic/src/main/java/ghidra/util/TestSuiteUtilities.java