code: public static <T> T create(Class<T> type, Object[] args, int offset, int count) throws
      NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
          if (offset != 0 || count != args.length) {
              return create(type, Arrays.copyOfRange(args, offset, offset + count));
          } else {
              return create(type, args);
          }
      }
docs: Creates an instance of a given type by choosing the best constructor that matches the given list of arguments.
  
  @param <T> the type of the object to create
  @param type the type of the object to create
  @param args the arguments to pass to the constructor
  @param offset the offset into the args array from which to retrieve arguments
  @param count the number of arguments from the args array to pass to the constructor
  @return the object created
  @throws NoSuchMethodException if an appropriate constructor cannot be found
  @throws IllegalAccessException if an appropriate constructor cannot be accessed
  @throws InvocationTargetException if errors occur while invoking the constructor
  @throws InstantiationException if the constructor itself fails in any way