code: public static <T> T newInstanceOrNull(Class<? extends T> clazz, Object...params)  {
          Constructor<T> constructor = selectMatchingConstructor(clazz, params);
          if (constructor == null) {
              return null;
          }
          try {
              return constructor.newInstance(params);
          } catch (IllegalAccessException e) {
              return null;
          } catch (InstantiationException e) {
              return null;
          } catch (InvocationTargetException e) {
              return null;
          }
      }
docs: Create a new instance of a given class. It will search for a constructor matching passed parameters.
  If a matching constructor is not found then it returns null.
  
  Constructor is matching when it can be invoked with given parameters. The order of parameters is significant.
  
  When a class constructor contains a primitive argument then it's matching if and only if
  a parameter at the same position is not null.
  
  It throws {@link AmbigiousInstantiationException} when multiple matching constructors are found.
  
  @param clazz class to be instantiated
  @param params parameters to be passed to the constructor
  @param <T> class type to be instantiated
  @return a new instance of a given class
  @throws AmbigiousInstantiationException when multiple constructors matching the parameters