code: public static String lambdaParameterName( Serializable lambda )
      {
          SerializedLambda serialized = serializedLambda( lambda );
          Parameter[] parameters = lambdaMethod( serialized ).getParameters();
          int bound;
          switch ( serialized.getImplMethodKind() )
          {
          case REF_invokeStatic:
              bound = serialized.getCapturedArgCount();
              break;
          case REF_invokeSpecial:
              bound = serialized.getCapturedArgCount() - 1;
              break;
          default:
              throw new IllegalArgumentException( "Unsupported method kind: " + serialized.getImplMethodKind() );
          }
          if ( parameters == null || (parameters.length - bound) != 1 )
          {
              throw new IllegalArgumentException(
                      "Must have exactly one parameter, not " + (parameters == null ? 0 : parameters.length) +
                      "; " + Arrays.toString( parameters ) + ", bound: " + bound );
          }
          Parameter parameter = parameters[bound];
          if ( !parameter.isNamePresent() )
          {
              throw new IllegalStateException(
                      "No parameter name present, compile with '-parameters', and use JDK 1.8.0_60 or newer. " +
                      "Your JDK version is " + System.getProperty( "java.version" ) );
          }
          return parameter.getName();
      }
docs: Get the parameter name of a ({@linkplain Serializable serializable}) lambda with a single parameter.
  <p>
  Getting the parameter requires the source to be compiled with the {@code -parameters} flag passed to {@code
  javac} and JDK {@code 1.8.0_60} or newer.
  
  @param lambda the ({@linkplain Serializable serializable}) lambda to get the parameter name from.
  @return the name of the sole parameter of the lambda.