private static @Nullable String createIfCondition(PsiTypeTestPattern typeTestPattern,
                                                    String expressionText,
                                                    CommentTracker commentTracker) {
    PsiTypeElement checkType = typeTestPattern.getCheckType();
    if (checkType == null) return null;
    String typeText = commentTracker.textWithComments(checkType);
    PsiPatternVariable variable = typeTestPattern.getPatternVariable();
    if (variable == null) return null;
    PsiElement context = PsiTreeUtil.getParentOfType(variable, PsiSwitchStatement.class);
    boolean isUsedPatternVariable = VariableAccessUtils.variableIsUsed(variable, context);
    PsiIdentifier identifier = variable.getNameIdentifier();
    String variableName = isUsedPatternVariable ? commentTracker.textWithComments(identifier) : commentTracker.commentsBefore(identifier);
    return expressionText + " instanceof " + typeText + " " + variableName;
  }
private static @Nullable String createIfCondition(PsiTypeTestPattern typeTestPattern,
                                                    String expressionText,
                                                    CommentTracker commentTracker)