class Test {
    static class Inner {
        int foo() { return 0; }
        Integer fooBoxed() { return 0; }
    }

    void test(Stream<Inner> sp) {
        IntStream mi = sp.map(Inner::foo);
        Stream<Integer> mI = sp.map(Inner::fooBoxed);

        IntStream li = sp.map<error descr="Ambiguous method call: both 'Stream.map(Function<? super Inner, ?>)' and 'Stream.map(IntFunction<? super Inner>)' match">(inner->inner.foo())</error>;
        Stream<Integer> lI = sp.map<error descr="Ambiguous method call: both 'Stream.map(Function<? super Inner, ?>)' and 'Stream.map(IntFunction<? super Inner>)' match">(inner -> inner.fooBoxed())</error>;
    }

    interface Stream<T> {
        <R> Stream<R> map(Function<? super T, ? extends R> mapper);
        IntStream map(IntFunction<? super T> mapper);
    }

    interface Function<T, R> {
        public R f(T t);
    }

    interface IntFunction<T> {
        public int f(T t);
    }

    interface IntStream {}
}