code: public static Set<Class<?>> scanPackage(ClassLoader classLoader, String pkg) throws IOException {
          Reflections reflections = new Reflections(new ConfigurationBuilder()
                  .addUrls(ClasspathHelper.forPackage(pkg, classLoader))
                  .addClassLoader(classLoader)
                  .setScanners(new SubTypesScanner(false)));
          Set<Class<?>> classes = new HashSet<Class<?>>();
          for (String typeNames : reflections.getStore().get(SubTypesScanner.class.getSimpleName()).values()) {
              Class<?> clazz = safeClassForName(classLoader, typeNames);
              if (clazz != null) {
                  classes.add(clazz);
              }
          }
          return classes;
      }
docs: Return the classes from the given package and subpackages using the supplied classloader
  
  @param classLoader classloader to be used
  @param pkg package to scan
  @return set of found classes
  @throws IOException