title: Java-8 Lambda expression - Functional Interface type
body: <p>I have a ProxyGenerator which looks like the one at bottom. My problem now is that I don't know which type this is:</p>
  
  <pre><code>Consumer&lt;...?????&gt; myConsumer = (proxy, method, args) -&gt; method.invoke(realSubject, args);
  </code></pre>
  
  <p>Consumer is wrong, is there a simple way of determine of which type the Lambda expression is (e.g. with Eclipse)?</p>
  
  <pre><code>public class ProxyGenerator {
  
      public static &lt;P&gt; P makeProxy(Class&lt;P&gt; subject, P realSubject) {
  
          Consumer&lt;Subject_A&gt; myConsumer = (proxy, method, args) -&gt; method.invoke(realSubject, args);
  
          final Object proxyInstance = Proxy.newProxyInstance(subject.getClassLoader(), new Class&lt;?&gt;[] { subject },
              (proxy, method, args) -&gt; method.invoke(realSubject, args));
          return subject.cast(proxyInstance);
      }
  }
  </code></pre>