Java Stream map(…) – error while passing custom Function, though accepting methodReference

You must pass in something that implements java.util.function.Function. You have two main choices:

  • make Try extend Function
  • convert Try to a Function, e.g. map(try1::apply)

You cannot get around the need to pass in a Function to map.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top