@Nullable
  public static ExceptionLineRefiner.RefinerMatchResult matchCompilerGeneratedNullCheck(PsiElement e) {
    PsiExpression dereferenced = null;
    boolean forward = true;
    if (PsiTreeUtil.nextVisibleLeaf(e) instanceof PsiJavaToken token &&
        token.getTokenType().equals(JavaTokenType.DOUBLE_COLON)) {
      // method reference qualifier
      PsiMethodReferenceExpression methodRef = tryCast(token.getParent(), PsiMethodReferenceExpression.class);
      if (methodRef != null) {
        dereferenced = methodRef.getQualifierExpression();
        forward = false;
      }
    }
    else if (e instanceof PsiJavaToken && e.textMatches("(") &&
             PsiTreeUtil.prevVisibleLeaf(e) instanceof PsiKeyword startSwitch &&
             startSwitch.textMatches(PsiKeyword.SWITCH)) {
      PsiSwitchBlock switchBlock = tryCast(startSwitch.getParent(), PsiSwitchBlock.class);
      if (switchBlock != null) {
        PsiExpression selector = switchBlock.getExpression();
        if (selector != null) {
          PsiType psiType = selector.getType();
          if (!(psiType instanceof PsiPrimitiveType || PsiPrimitiveType.getUnboxedType(psiType) != null)) {
            dereferenced = selector;
          }
        }
      }
    }
    else if (e instanceof PsiIdentifier &&
             PsiTreeUtil.nextVisibleLeaf(e) instanceof PsiJavaToken dot &&
             dot.getTokenType().equals(JavaTokenType.DOT) &&
             PsiTreeUtil.nextVisibleLeaf(dot) instanceof PsiKeyword newKeyWord &&
             newKeyWord.textMatches(PsiKeyword.NEW)) {
      // qualified new
      PsiNewExpression newExpression = tryCast(newKeyWord.getParent(), PsiNewExpression.class);
      if (newExpression != null) {
        dereferenced = newExpression.getQualifier();
      }
    }
    return mayBeNull(dereferenced) ? onTheSameLineFor(e, dereferenced, forward) : null;
  }
@Nullable
  public static ExceptionLineRefiner.RefinerMatchResult matchCompilerGeneratedNullCheck(PsiElement e)