Is there a way in Java8 to use a method reference as a Function object to use its methods, something like:
Function
Stream.of(\"ciao\", \"hola\", \"hello
You can use a cast
Stream.of("ciao", "hola", "hello") .map(((Function) String::length) .andThen(n -> n * 2)) .forEach(System.out::println);
prints
8 8 10