> comparing((IntFunction<T>) x -> x.size()) is not too bad IMHO. or comparing((Foo x) -> x.size()) Its not completely intuitive that adding the argument type helps the compiler determine the best return type, but it does, because it enables the lambda to be type-checked bottom up (since it contains no inference variables anymore.)