import java.util.*; class Main { void test(List li) { Fun, Stream> f = s -> s.substr(0); foo(li, f, Collections.emptyList()); foo(li, s -> s.substr(0), Collections.emptyList()); } , It extends Iterable> Collection foo(Collection coll, Fun, S_OUT> f, It it) { return null; } interface Stream { Stream substr(long startingOffset); } interface Fun { R f(T t); } }