import java.util.*;
class GenericsTest<T> {

    static <S> S next(GenericsTest<S> test)
    {
        System.out.println(test);
        return null;
    }

    public Iterator<T> iterator()
    {
        return new Iterator<T>() {
            @Override
            public boolean hasNext()
            {
                return false;
            }

            @Override
            public T next()
            {
                return GenericsTest.next(GenericsTest.this);
            }

            @Override
            public void remove()
            {
            }
        };
    }
}

class GenericsTest1<T> {

    static <S> S next1(GenericsTest1<S> test)
    {
        System.out.println(test);
        return null;
    }

    public Iterator<T> iterator()
    {
        return new Iterator<T>() {
            @Override
            public boolean hasNext()
            {
                return false;
            }

            @Override
            public T next()
            {
                return GenericsTest1.next1(GenericsTest1.this);
            }

            @Override
            public void remove()
            {
            }
        };
    }
}


class GenericsTest2<T> {

    static <S> S next2(GenericsTest2<S> test)
    {
        System.out.println(test);
        return null;
    }

    public Iterator<T> iterator()
    {
        return new Iterator<T>() {
            @Override
            public boolean hasNext()
            {
                return false;
            }

            @Override
            public T next()
            {
                return next2(GenericsTest2.this);
            }

            @Override
            public void remove()
            {
            }
        };
    }
}
@@ -1,8 +1,35 @@
+import java.lang.Override;%0A
 import j
@@ -1736,28 +1736,854 @@
         %7D%0A        %7D;%0A    %7D%0A%7D
+%0Aclass Example %7B%0A    private static %3CT%3E void assertThat(T actual, Matcher%3C? super T%3E matcher) %7B%0A      assert actual != null;%0A      assert matcher != null;%0A    %7D%0A%0A    private static %3CE%3E Matcher%3C? super Collection%3C? extends E%3E%3E hasSize(int size) %7B%0A        assert size %3E=0;%0A        return new Matcher%3CCollection%3C? extends E%3E%3E() %7B%0A          @Override%0A          public void foo(Collection%3C? extends E%3E es) %7B%0A            System.out.println(es);%0A          %7D%0A        %7D;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A      List%3CBoolean%3E list = %3Cwarning descr=%22Unchecked assignment: 'java.util.ArrayList' to 'java.util.List%3Cjava.lang.Boolean%3E'%22%3Enew ArrayList()%3C/warning%3E;%0A      System.out.println(list);%0A      assertThat(new ArrayList%3CBoolean%3E(), hasSize(0));%0A    %7D%0A%0A    private interface Matcher%3CT%3E %7B%0A      void foo(T t);%0A    %7D%0A%7D

test data for (IDEA-70468)