code: public static Object invokeMethod(Object obj, Method method, Object... params) {
          try {
              method.setAccessible(true);
              return method.invoke(obj, params);
          }
          catch (IllegalArgumentException | IllegalAccessException | InvocationTargetException ex) {
              throw new RuntimeException(ex);
          }
      }
docs: Invokes a method on the object using reflection.
  
  @param obj
  @param method
  @param params
  @return