void () { Function<String, Integer> lookup = Integer::parseInt; UnaryOperator<String> selector = String::trim; BinaryOperator<Integer> min = Math::min; String foo = "xyz"; /*check*/ boolean b = selector.andThen(Collections.singleton(/* "xyz" here */ "xyz")::contains).apply(/* foo here */ foo); }