void (@NotNull PsiTypeElement typeElement) { super.visitTypeElement(typeElement); final PsiType type = typeElement.getType(); if (!TypeUtils.isOptional(type)) { return; } final PsiJavaCodeReferenceElement referenceElement = typeElement.getInnermostComponentReferenceElement(); if (referenceElement == null) { return; } final PsiReferenceParameterList parameterList = referenceElement.getParameterList(); if (parameterList == null) { return; } final PsiTypeElement[] typeParameterElements = parameterList.getTypeParameterElements(); if (typeParameterElements.length != 1) { return; } final PsiTypeElement typeParameterElement = typeParameterElements[0]; final PsiType parameterType = typeParameterElement.getType(); if (!(parameterType instanceof PsiArrayType) && !CollectionUtils.isCollectionClassOrInterface(parameterType)) { return; } registerError(typeParameterElement, parameterType); }