PsiType (@NotNull PsiType type, @NotNull PsiModifierList modifierList, PsiAnnotation @NotNull [] annotations) { TypeAnnotationProvider original = modifierList.getParent() instanceof PsiMethod ? type.getAnnotationProvider() : TypeAnnotationProvider.EMPTY; TypeAnnotationProvider provider = new FilteringTypeAnnotationProvider(annotations, original); return type.annotate(provider); }