code: static <T> T newInstance(final String className, final Class<?>[] argumentTypes, final Object[] arguments,
          final Class<T> expectedType, final ClassLoader cl) {
          // Precondition checks
          if (className == null) {
              throw new IllegalArgumentException("ClassName must be specified");
          }
          if (argumentTypes == null) {
              throw new IllegalArgumentException("ArgumentTypes must be specified. Use empty array if no arguments");
          }
          if (arguments == null) {
              throw new IllegalArgumentException("Arguments must be specified. Use empty array if no arguments");
          }
          if (expectedType == null) {
              throw new IllegalArgumentException("Expected type must be specified");
          }
          if (cl == null) {
              throw new IllegalArgumentException("CL must be specified");
          }
  
          final Class<?> implClass;
          try {
              implClass = Class.forName(className, false, cl);
          } catch (ClassNotFoundException cnfe) {
              throw new IllegalArgumentException("Could not find class named " + className + " in the specified CL: "
                  + cl, cnfe);
          }
  
          // Delegate
          return newInstance(implClass, argumentTypes, arguments, expectedType);
      }
docs: Create a new instance by finding a constructor that matches the argumentTypes signature using the arguments for
  instantiation.
  
  @param className
  Full classname of class to create
  @param argumentTypes
  The constructor argument types
  @param arguments
  The constructor arguments
  @param cl
  The ClassLoader to use in constructing the new instance
  @return a new instance
  @throws IllegalArgumentException
  if className, argumentTypes, ClassLoader, or arguments are null
  @throws RuntimeException
  if any exceptions during creation
  @author <a href="mailto:aslak@conduct.no">Aslak Knutsen</a>
  @author <a href="mailto:andrew.rubinger@jboss.org">ALR</a>