code: public static <T> T newInstance(Class<T> pClass, Object ... pArguments) {
          try {
              if (pClass != null) {
                  if (pArguments.length == 0) {
                      return pClass.newInstance();
                  } else {
                      Constructor<T> ctr = lookupConstructor(pClass, pArguments);
                      return ctr.newInstance(pArguments);
                  }
              } else {
                  throw new IllegalArgumentException("Given class must not be null");
              }
          } catch (InstantiationException e) {
              throw new IllegalArgumentException("Cannot instantiate " + pClass + ": " + e,e);
          } catch (IllegalAccessException e) {
              throw new IllegalArgumentException("Cannot instantiate " + pClass + ": " + e,e);
          } catch (NoSuchMethodException e) {
              throw new IllegalArgumentException("Cannot instantiate " + pClass + ": " + e,e);
          } catch (InvocationTargetException e) {
              throw new IllegalArgumentException("Cannot instantiate " + pClass + ": " + e,e);
          }
      }
docs: Instantiate an instance of the given class with its default constructor
  
  @param pClass class to instantiate
  @param pArguments optional constructor arguments. Works only for objects with the same class as declared in
  the constructor types (no subclasses)
  @param <T> type object type
  @return instantiated object
  @throws IllegalArgumentException if the class could not be found or instantiated