void () { Factory<PsiMethod> createMethod = () -> { LightMethodBuilder method = new LightMethodBuilder(getPsiManager(), "foo"); LightTypeParameterBuilder typeParam = new LightTypeParameterBuilder("T", method, 0); method.addTypeParameter(typeParam); PsiClassType tType = JavaPsiFacade.getElementFactory(getProject()).createType(typeParam); method.setMethodReturnType(tType); method.addParameter("p", tType); return method; }; assertTrue(getPsiManager().areElementsEquivalent(createMethod.create(), createMethod.create())); }