Sonar tells me: "Replace this lambda with a method reference"
public class MyClass { private List<SomeValue> createSomeValues(List<Anything> anyList) { return anyList
Is this possible here? I tried several things, for example
.map(MyClass::createSomeValue)
but I need to change the method to static. And I'm not a big fan of static methods.
SonarQube explanation:
Method / constructor references are more compact and readable than using lambda, and therefore they are preferred.
source share