static List<NullabilityProblem<?>> postprocessNullabilityProblems(Collection<NullabilityProblem<?>> problems) {
    List<NullabilityProblem<?>> unchanged = new ArrayList<>();
    Map<PsiExpression, NullabilityProblem<?>> expressionToProblem = new HashMap<>();
    for (NullabilityProblem<?> problem : problems) {
      PsiExpression expression = problem.getDereferencedExpression();
      NullabilityProblemKind<?> kind = problem.getKind();
      if (expression == null) {
        unchanged.add(problem);
        continue;
      }
      if (innerClassNPE == kind || callNPE == kind || arrayAccessNPE == kind || fieldAccessNPE == kind) {
        // Qualifier-problems are reported on top-expression level for now as it's rare case to have
        // something complex in qualifier and we highlight not the qualifier itself, but something else (e.g. called method name)
        boolean unknown = problem.hasUnknownNullability();
        problem = problem.withExpression(findTopExpression(expression));
        if (unknown) {
          problem = problem.makeUnknown();
        }
        unchanged.add(problem);
        continue;
      }
      // Merge ternary problems reported for both branches into single problem
      while (true) {
        PsiExpression top = skipParenthesesAndObjectCastsUp(expression);
        PsiConditionalExpression ternary = tryCast(top.getParent(), PsiConditionalExpression.class);
        if (ternary != null) {
          PsiExpression otherBranch = null;
          if (ternary.getThenExpression() == top) {
            otherBranch = ternary.getElseExpression();
          }
          else if (ternary.getElseExpression() == top) {
            otherBranch = ternary.getThenExpression();
          }
          if (otherBranch != null) {
            otherBranch = skipParenthesesAndObjectCastsDown(otherBranch);
            NullabilityProblem<?> otherBranchProblem = expressionToProblem.remove(otherBranch);
            if (otherBranchProblem != null) {
              expression = ternary;
              boolean unknown = problem.hasUnknownNullability() && otherBranchProblem.hasUnknownNullability();
              problem = problem.withExpression(ternary);
              if (unknown) {
                problem = problem.makeUnknown();
              }
              continue;
            }
          }
        }
        break;
      }
      expressionToProblem.put(expression, problem);
    }
    return StreamEx.of(unchanged, expressionToProblem.values()).toFlatList(Function.identity());
  }
static List<NullabilityProblem<?>> postprocessNullabilityProblems(Collection<NullabilityProblem<?>> problems)