private void addClasses(@NotNull Class<?>[] classes) {
      Queue<Class<?>> queue = new ArrayDeque<>();
      Collections.addAll(queue, classes);

      while (true) {
        Class<?> next = queue.poll();
        if (next == null) break;
        String className = next.getName();

        try {
          //skip array classes
          if (next.isArray()) continue;
          if (className.contains("$$Lambda$")) continue;
          if (className.startsWith("java.lang.invoke.LambdaForm$")) continue;
          if (className.startsWith("jdk.internal.reflect.Generated")) continue;
          if (className.startsWith("com.sun.proxy.$Proxy")) continue;
          if (className.contains(".$Proxy")) continue;
          if (className.startsWith("java.lang.invoke.BoundMethodHandle$")) continue;

          if (!allMyClasses.add(next)) continue;

          Class<?> superclass = next.getSuperclass();
          if (superclass != null) queue.add(superclass);
          Collections.addAll(queue, next.getInterfaces());
        }
        catch (Throwable t) {
          log("Failed to process " + className, t);
        }
      }
    }
private void addClasses(@NotNull Class<?>[] classes)