Guava has your first and third interfaces (called Function
and Predicate
). Your second, IMHO, is not useful because you just need to combine T1 and T2 in one object and use the first interface instead.
More interestingly, Guava also has many methods using these two interfaces, for example Iterables.any(Iterable, Predicate)
, Iterables.transform(Iterable, Function)
, etc.
source share