I have scanned serveral links but didn't find an easy solution for Java 8 Lambda expression. The most useful hint I've found was on Java 8 Lambdas but did NOT really satisfy my interest.
I want to achieve a reoccuring pattern in my code:
List<?> content=retrieveContent(strFilter);
if (!content.isEmpty())
setField1(content.get(0));
and I would like to have it simple as
retrieveContent(strFilter, this::setField1)
but somehow I don't get syntax properly - especially for the method. I can do it as a String and call if via method, but than its prone to typos... Any other ideas?