title: Noticable differences to consider when choosing between lambda, method reference and method with Function<> return value
body: <p>when running this code snippet. Is there any noticeable difference in performance or something else to take into consideration when choosing between a lambda, a method reference or a method with a Function as return value?</p>
  <pre><code>import java.util.function.Function;
  import java.util.stream.Stream;
  
  public class Main {
  
    public static void main(String[] args) {
      Stream&lt;String&gt; firstStream = Stream.of(&quot;qwerty&quot;, &quot;asdfgh&quot;, &quot;zxcvbn&quot;)
          .map(s -&gt; s.concat(s));
  
      Stream&lt;String&gt; secondStream = Stream.of(&quot;qwerty&quot;, &quot;asdfgh&quot;, &quot;zxcvbn&quot;)
          .map(Main::selfConcatenateReference);
  
      Stream&lt;String&gt; thirdStream = Stream.of(&quot;qwerty&quot;, &quot;asdfgh&quot;, &quot;zxcvbn&quot;)
          .map(selfConcatenateFunction());
    }
  
    private static Function&lt;String, String&gt; selfConcatenateFunction() {
      return s -&gt; s.concat(s);
    }
  
    private static String selfConcatenateReference(String s) {
      return s.concat(s);
    }
  }
  </code></pre>