title: SONAR: Replace this lambda with a method reference
body: <p>Sonar tells me "Replace this lambda with a method reference"</p>
  
  <pre><code>public class MyClass {
  
      private List&lt;SomeValue&gt; createSomeValues(List&lt;Anything&gt; anyList) {
          return anyList //
                 .stream() //
                 .map(anything -&gt; createSomeValue(anything)) //
                 .collect(Collectors.toList());
     }
  
      private SomeValue createSomeValue(Anything anything) {
          StatusId statusId = statusId.fromId(anything.getStatus().getStatusId());
          return new SomeValue(anything.getExternId(), statusId);
      }
  
  }
  </code></pre>
  
  <p>Is this possible here? I tried several things, like</p>
  
  <pre><code>.map(MyClass::createSomeValue) //
  </code></pre>
  
  <p>but I need to change the method to static then. And I am not a big fan of static methods.</p>
  
  <p>Explanation of SonarQube is:</p>
  
  <blockquote>
    <p>Method/constructor references are more compact and readable than using lambdas, and are therefore preferred.</p>
  </blockquote>