public static Class[] findClassesOfType(String packageNameToSearch,
                                            Class<?> typeDesired) {
        ArrayList<Class<?>> classesFound = new ArrayList<Class<?>>();
        String[] classNames = findClassNames(packageNameToSearch);
        for (String className : classNames) {
            String fullName = packageNameToSearch.length() > 0 ? (packageNameToSearch
                    + "." + className)
                    : className;
            if (isPublicConcreteClassOfType(fullName, typeDesired)) {
                try {
                    classesFound.add(Class.forName(fullName));
                } catch (Exception ignored) {
                    // ignore classes that we cannot instantiate
                }
            }
        }
        return classesFound.toArray(new Class[classesFound.size()]);
    }