docs: @SuppressWarnings("unchecked")
    public static <T> Class<T> forNameEx(String className) throws ClassNotFoundException, ClassCastException, NullPointerException
    {
      ClassLoader loader = Thread.currentThread().getContextClassLoader();
      ClassNotFoundException classNotFoundException = null;
      if(loader != null) {
        try {
          return (Class<T>)Class.forName(className, true, loader);
        }
        catch(ClassNotFoundException expected) {
          classNotFoundException = expected;
        }
      }
  
      // try library class loader only if not the same as current thread context class loader, already tried
      if(classNotFoundException != null && loader.equals(Classes.class.getClassLoader())) {
        throw classNotFoundException;
      }
      return (Class<T>)Class.forName(className, true, Classes.class.getClassLoader());
    }