docs: @SuppressWarnings( "unchecked" )
      public static <T> T getInstance(String classname, ClassLoader cl) {
          if (classname == null) throw new IllegalArgumentException("Cannot load null class!");
          Class<T> clazz = null;
          try {
              clazz = (Class<T>)Class.forName(classname, true, cl);
              // first look for a getInstance() constructor
              T instance = null;
              try {
                  Method factoryMethod = getFactoryMethod(clazz);
                  if (factoryMethod != null) instance = (T) factoryMethod.invoke(null);
              }
              catch (Exception e) {
                  // no factory method or factory method failed.  Try a constructor.
                  instance = null;
              }
              if (instance == null) {
                  instance = clazz.newInstance();
              }
              return instance;
          } catch (Exception e) {
              throw new RuntimeException(e);
          }
      }