title: Method reference - invalid method reference - cannot be reference from static context
body: <p>I have following piece of code </p>
  
  <pre><code>StringJoiner joiner = new StringJoiner(", ");
  joiner.add("Something");
  Function&lt;StringJoiner,Integer&gt; lengthFunc =  StringJoiner::length;
  Function&lt;CharSequence,StringJoiner&gt; addFunc = StringJoiner::add;
  </code></pre>
  
  <p>Last line cause an error </p>
  
  <pre><code>Error:(54, 53) java: invalid method reference
    non-static method add(java.lang.CharSequence) cannot be referenced from a static context
  </code></pre>
  
  <p>I understand that this method can't be used in static way and I should have something like :</p>
  
  <pre><code>Function&lt;CharSequence,StringJoiner&gt; addFunc = joiner::add;
  </code></pre>
  
  <p>instead. However I can't understand why third line, with <code>StringJoiner::length;</code> is for java compiler perfectly correct. Can someboedy explain me why is that ?</p>