public void collect(@NotNull PsiFile file) {
        // Step 1: mark all types with known nullability inferred from Java DFA
        file.accept(new JavaRecursiveElementWalkingVisitor() {
            @Override
            public void visitTypeElement(@NotNull PsiTypeElement typeElement) {
                super.visitTypeElement(typeElement);
                PsiType type = typeElement.getType();
                Nullability nullability = DfaPsiUtil.getTypeNullability(type);
                switch (nullability) {
                    case NULLABLE -> registerNullableType(type);
                    case NOT_NULL -> registerNotNullType(type);
                }
            }
        });

        // Step 2: infer nullability for the rest of types
        int prevNumAnnotationsAdded;
        int pass = 0;
        do {
            final NullityInferrerVisitor visitor = new NullityInferrerVisitor();
            prevNumAnnotationsAdded = numAnnotationsAdded;
            file.accept(visitor);
            pass++;
        }
        while (prevNumAnnotationsAdded < numAnnotationsAdded && pass < MAX_PASSES);
    }
public void collect(@NotNull PsiFile file)