title: Can we get a method name using java.util.function?
body: <p>I tried to do:</p>
  
  <pre class="lang-java prettyprint-override"><code>public class HelloWorld {
       public static void main(String... args){
          final String string = "a";
          final Supplier&lt;?&gt; supplier = string::isEmpty;
          System.out.println(supplier);
       }
  }
  </code></pre>
  
  <p>I get:</p>
  
  <pre class="lang-java prettyprint-override"><code>HelloWorld$$Lambda$1/471910020@548c4f57
  </code></pre>
  
  <p>I would like to get the string <code>isEmpty</code>. How can I do this?</p>
  
  <p>EDIT: the code of the method I created is this one:</p>
  
  <pre class="lang-java prettyprint-override"><code>public class EnumHelper {
      private final static String values = "values";
      private final static String errorTpl = "Can't find element with value `{0}` for enum {1} using getter {2}()";
  
      public static &lt;T extends Enum&lt;T&gt;, U&gt; T getFromValue(T enumT, U value, String getter) {
          @SuppressWarnings("unchecked")
          final T[] elements = (T[]) ReflectionHelper.callMethod(enumT, values);
  
          for (final T enm: elements) {
              if (ReflectionHelper.callMethod(enm, getter).equals(value)) {
                  return enm;
              }
          }
  
          throw new InvalidParameterException(MessageFormat.format(errorTpl, value, enumT, getter));
      }
  }
  </code></pre>
  
  <p>The problem is I can't pass as parameter T::getValue, since getValue is not static. And I can't pass someEnumElem::getValue, since the <code>get()</code> will return the value of that element. I could use inside the for loop:</p>
  
  <pre class="lang-java prettyprint-override"><code>Supplier&lt;U&gt; getterSupllier = enm:getValue;
  if (getterSupllier.get().equals(value)) {
      [...]
  }
  </code></pre>
  
  <p>but in this way <code>getValue</code> is fixed, I can't pass it as parameter. I could use some third-party library to do an <code>eval()</code>, but I really don't want to open that Pandora vase :D</p>
  
  <p>EDIT 2: <code>Function</code> does work with no parameters methods, but only in <code>Java</code> 11. Unluckily I'm stuck with <code>Java</code> 8.</p>