boolean (@Nullable PsiType type, @NotNull PsiElement context) { if (type == null || type instanceof PsiWildcardType) return false; PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(context.getProject()); try { PsiType typeAfterReplacement = elementFactory.createTypeElementFromText(type.getCanonicalText(), context).getType(); return type.equals(typeAfterReplacement); } catch (IncorrectOperationException e) { return false; } }