code: @Nullable
      public static Class<?> findAssignableClass(ScriptModule module, Class<?> targetClass) {
          for (Class<?> candidateClass : module.getLoadedClasses()) {
              if (targetClass.isAssignableFrom(candidateClass)) {
                  return candidateClass;
              }
          }
          return null;
      }
docs: Find the first class in the module that is a subclasses or equal to the target class
  @param module module to search
  @param targetClass target type to search for
  @return first instance that matches the given type