code: public static MethodParameter forMethodOrConstructor(Object methodOrConstructor, int parameterIndex) {
          if (methodOrConstructor instanceof Method) {
              return new MethodParameter((Method) methodOrConstructor, parameterIndex);
          } else if (methodOrConstructor instanceof Constructor) {
              return new MethodParameter((Constructor<?>) methodOrConstructor, parameterIndex);
          } else {
              throw new IllegalArgumentException(
                      "Given object [" + methodOrConstructor + "] is neither a Method nor a Constructor");
          }
      }
docs: Create a new MethodParameter for the given method or constructor.
  <p>
  This is a convenience constructor for scenarios where a Method or Constructor reference is treated in a generic fashion.
  
  @param methodOrConstructor the Method or Constructor to specify a parameter for
  @param parameterIndex the index of the parameter
  @return the corresponding MethodParameter instance