private static @Nullable String createIfCondition(PsiPattern pattern,
                                                    @Nullable PsiExpression guard,
                                                    String expressionText,
                                                    CommentTracker commentTracker) {
    String patternCondition = null;
    if (pattern instanceof PsiTypeTestPattern typeTestPattern) {
      patternCondition = createIfCondition(typeTestPattern, expressionText, commentTracker);
    }
    else if (pattern instanceof PsiDeconstructionPattern deconstructionPattern) {
      patternCondition = createIfCondition(deconstructionPattern, expressionText, commentTracker);
    }
    if (guard == null || patternCondition == null) return patternCondition;
    return patternCondition +
           "&&" +
           commentTracker.textWithComments(guard, ParenthesesUtils.AND_PRECEDENCE);
  }
private static @Nullable String createIfCondition(PsiPattern pattern,
                                                    @Nullable PsiExpression guard,
                                                    String expressionText,
                                                    CommentTracker commentTracker)