title: how to call a lambda of unknown type
body: <p>Consider we have a set of variables containing references to methods:</p>
  
  <pre><code>public double m2(String s, int n){return n;}
  Runnable r = ()-&gt;{};
  Consumer&lt;String&gt; c1 = System.out::println;
  BiFunction&lt;String, Integer, Double&gt; f2 = this::m2;
  </code></pre>
  
  <p>We can call them in different ways, depending on concrete variable type:</p>
  
  <pre><code>    r.run();
      c1.accept("Hello");
      Object res = f2.apply("Hello", 1);
  </code></pre>
  
  <p>Now, I need a global method to invoke any type of referenced methods:</p>
  
  <pre><code>public static Object call(Object lambda, Object... args) {...}
  Object res0 = call(r); // returns null
  Object res1 = call(c1, "Hello");
  Object res2 = call(f2, "Hello", 1)
  </code></pre>
  
  <p>How to implement this method? The set of possible functional types of the parameter <code>lambda</code> is not limited.</p>