docs: public Set<Class<?>> getPackageAllClasses(String basePackage,
                                                boolean recursive) {
          Set<Class<?>> classes = new LinkedHashSet<Class<?>>();
          String packageName = basePackage;
          if (packageName.endsWith(".")) {
              packageName = packageName
                      .substring(0, packageName.lastIndexOf('.'));
          }
          String package2Path = packageName.replace('.', '/');
  
          Enumeration<URL> dirs;
          try {
              dirs = Thread.currentThread().getContextClassLoader().getResources(
                      package2Path);
              while (dirs.hasMoreElements()) {
                  URL url = dirs.nextElement();
                  String protocol = url.getProtocol();
                  if ("file".equals(protocol)) {
                      String filePath = URLDecoder.decode(url.getFile(), "UTF-8");
                      doScanPackageClassesByFile(classes, packageName, filePath, recursive);
                  } else if ("jar".equals(protocol)) {
                      doScanPackageClassesByJar(packageName, url, recursive, classes);
                  }
              }
          } catch (IOException e) {
              throw new LtsRuntimeException(e);
          }
          return classes;
      }