title: Limits of static method references in Java 8
body: <p>I'm trying to use method references to capture method invocations and am hitting some limitations. This works fine:</p>
  
  <pre><code>&lt;T&gt; void capture(Function&lt;T, ?&gt; in) {
  }
  
  private interface Foo {
    String getBar();
  } 
  
  capture(Foo::getBar);
  </code></pre>
  
  <p>But if I change the signature of Foo.setBar to something like this:</p>
  
  <pre><code>private interface Foo {
    void setBar(String bar);
  }
  
  capture(Foo::setBar);
  </code></pre>
  
  <p>I get an error:</p>
  
  <p><code>Cannot make a static reference to the non-static method setBar(String) from the type MyTest.Foo</code></p>
  
  <p>It's not clear to me what the restriction is. Ideally I'd like to use method references to capture invocations on standard setter. Is there any way to do this? </p>