void () { final GlobalSearchScope scope = GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(myModule); final PsiClassType javaLangObject = PsiType.getJavaLangObject(myPsiManager, scope); PsiElement element = ((PsiDeclarationStatement)myJavaFacade.getElementFactory().createStatementFromText("X<? extends Y, ? super Z<A,B>, ?> x;", null)).getDeclaredElements()[0]; PsiJavaCodeReferenceElement referenceElement = ((PsiVariable) element).getTypeElement().getInnermostComponentReferenceElement(); PsiType[] typeArguments = referenceElement.getTypeParameters(); assertEquals(3, typeArguments.length); assertTrue(typeArguments[0] instanceof PsiWildcardType); assertTrue(typeArguments[1] instanceof PsiWildcardType); assertTrue(typeArguments[2] instanceof PsiWildcardType); PsiWildcardType extendsWildcard = (PsiWildcardType)typeArguments[0]; PsiWildcardType superWildcard = (PsiWildcardType)typeArguments[1]; PsiWildcardType unboundedWildcard = (PsiWildcardType)typeArguments[2]; // extends wildcard test assertTrue(extendsWildcard.isExtends()); assertFalse(extendsWildcard.isSuper()); assertEquals("Y", extendsWildcard.getBound().getCanonicalText()); assertEquals("Y", extendsWildcard.getExtendsBound().getCanonicalText()); assertEquals(extendsWildcard.getSuperBound(), PsiTypes.nullType()); // super wildcard test assertFalse(superWildcard.isExtends()); assertTrue(superWildcard.isSuper()); assertEquals("Z<A,B>", superWildcard.getBound().getCanonicalText()); assertEquals(superWildcard.getExtendsBound(), javaLangObject); assertEquals("Z<A,B>", superWildcard.getSuperBound().getCanonicalText()); // unbounded wildcard test assertFalse(unboundedWildcard.isExtends()); assertFalse(unboundedWildcard.isSuper()); assertNull(unboundedWildcard.getBound()); assertEquals(unboundedWildcard.getExtendsBound(), javaLangObject); assertEquals(unboundedWildcard.getSuperBound(), PsiTypes.nullType()); }