code: public static <T> T createInstance(Class<T> cls) {
          Constructor<T> ctor;
          try {
              ctor = findConstructor(cls);
          } catch (NoSuchMethodException e) {
              throw new IllegalArgumentException("Class " + cls.getName() +
                      " has no default (no arg) constructor");
          }
          try {
              return ctor.newInstance();
          } catch (Exception e) {
              ExceptionUtils.unwrapAndThrowAsIAE(e, "Unable to instantiate class " +
                      cls.getName() + ": " + e.getMessage());
              throw new IllegalArgumentException(e);
          }
      }
docs: Method that can be called to try to create an instantiate of
  specified type. Instantiation is done using default no-argument
  constructor.
  
  @param <T> the generic type
  @param cls the class to check
  @return an instantiated object
  @throws IllegalArgumentException if instantiation fails for any reason;
  except for cases where constructor throws an unchecked exception
  (which will be passed as is)