Created on 2019-03-27.20:14:11 by jamesmudd, last changed 2019-03-27.20:14:11 by jamesmudd.
||Author: James Mudd (jamesmudd)
It would be nice in Java 8 onward if Python functions could be used where functional interfaces specified by lambdas (or method refs) can be used in Java.
Examples would be in streams e.g.
filtered_list = al.stream().filter(moreThanThree).collect(toList())
See attached example for full code.
This fails at them moment because although Predicate is a @FunctionalInterface it also declares default methods. which results in it not being coerced in PyFunction.__tojava__(Class<?>)
Probably for after 2.7.1 it might be easier to implement when default methods can be introspected via reflection.