boolean (@NotNull PsiType type, @NotNull PsiAnnotation annotation) { if (type instanceof PsiArrayType) { return isSuitableInnerType(((PsiArrayType)type).getComponentType(), annotation); } if (type instanceof PsiClassType) { final PsiClassType.ClassResolveResult resolveResult = ((PsiClassType)type).resolveGenerics(); final PsiClass resolvedClass = resolveResult.getElement(); if (resolvedClass == null || !CommonClassNames.JAVA_UTIL_ITERATOR.equals(resolvedClass.getQualifiedName())) return false; final Map<PsiTypeParameter, PsiType> substitutionMap = resolveResult.getSubstitutor().getSubstitutionMap(); if (substitutionMap.size() != 1) return false; final PsiType genericType = ContainerUtil.getFirstItem(substitutionMap.values()); if (genericType == null) return false; return isSuitableInnerType(genericType, annotation); } return false; }