private static @Nullable AnalysisStartingPoint fromSwitchLabel(PsiSwitchLabelStatementBase label) {
    PsiSwitchBlock block = label.getEnclosingSwitchBlock();
    if (block == null) return null;
    boolean hasDefault = false;
    List<PsiExpression> labels = new ArrayList<>();
    if (label.isDefaultCase()) {
      hasDefault = true;
    } else {
      PsiExpressionList values = label.getCaseValues();
      if (values == null) return null;
      labels.addAll(Arrays.asList(values.getExpressions()));
    }
    if (label instanceof PsiSwitchLabelStatement) {
      PsiStatement prev = label;
      while (true) {
        prev = PsiTreeUtil.getPrevSiblingOfType(prev, PsiStatement.class);
        if (!(prev instanceof PsiSwitchLabelStatement)) {
          if (prev != null && ControlFlowUtils.statementMayCompleteNormally(prev)) return null;
          break;
        }
        if (((PsiSwitchLabelStatement)prev).isDefaultCase()) {
          hasDefault = true;
        } else {
          PsiExpressionList prevValues = ((PsiSwitchLabelStatement)prev).getCaseValues();
          if (prevValues == null) return null;
          labels.addAll(Arrays.asList(prevValues.getExpressions()));
        }
      }
    }
    if (hasDefault) {
      List<PsiExpression> allLabels = new ArrayList<>();
      for (PsiStatement statement : Objects.requireNonNull(block.getBody()).getStatements()) {
        if (statement instanceof PsiSwitchLabelStatementBase labelStatement) {
          if (labelStatement.isDefaultCase()) continue;
          PsiExpressionList caseValues = labelStatement.getCaseValues();
          if (caseValues == null) return null;
          allLabels.addAll(Arrays.asList(caseValues.getExpressions()));
        }
      }
      allLabels.removeAll(labels);
      labels = allLabels;
    }
    PsiExpression selector = block.getExpression();
    AnalysisStartingPoint result = null;
    for (PsiExpression labelValue : labels) {
      DfType type = AnalysisStartingPoint.fromConstant(labelValue);
      if (type == null) return null;
      AnalysisStartingPoint next = AnalysisStartingPoint.create(type, selector);
      if (hasDefault) {
        next = AnalysisStartingPoint.tryNegate(next);
      }
      if (next == null) return null;
      if (result == null) {
        result = next;
      } else {
        result = hasDefault ? result.tryMeet(next) : result.tryJoin(next);
        if (result == null) return null;
      }
    }
    return result;
  }
private static @Nullable AnalysisStartingPoint fromSwitchLabel(PsiSwitchLabelStatementBase label)