code: static <T> T newInstance(final Class<T> implClass, final Class<?>[] argumentTypes, final Object[] arguments)
      {
          if (implClass == null)
          {
              throw new IllegalArgumentException("ImplClass 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");
          }
          final T obj;
          try
          {
              Constructor<T> constructor = getConstructor(implClass, argumentTypes);
              if(!constructor.isAccessible()) {
                  constructor.setAccessible(true);
              }
              obj = constructor.newInstance(arguments);
          }
          catch (Exception e)
          {
              throw new RuntimeException("Could not create new instance of " + implClass, e);
          }
  
          return obj;
      }
docs: Create a new instance by finding a constructor that matches the argumentTypes signature
  using the arguments for instantiation.
  
  @param implClass Full classname of class to create
  @param argumentTypes The constructor argument types
  @param arguments The constructor arguments
  @return a new instance
  @throws IllegalArgumentException if className, argumentTypes, 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>