public static int getLogicalOperandCount(@Nullable PsiExpression condition) {
    PsiExpression unparenthesizedExpression = PsiUtil.skipParenthesizedExprDown(condition);
    if (!(unparenthesizedExpression instanceof PsiPolyadicExpression infixExpression)) {
      return 1;
    }
    if (!ANDAND.equals(infixExpression.getOperationTokenType())
        && !OROR.equals(infixExpression.getOperationTokenType())
        && (PsiTypes.booleanType().equals(infixExpression.getOperands()[0].getType())
            || PsiTypes.booleanType().equals(PsiPrimitiveType.getUnboxedType(infixExpression.getOperands()[0].getType()))
            || !Arrays.asList(AND, OR).contains(infixExpression.getOperationTokenType()))) {
      return 1;
    }
    int nbOperands= 0;
    for (PsiExpression operand : infixExpression.getOperands()) {
      nbOperands+= getLogicalOperandCount(operand);
    }
    return nbOperands;
  }
public static int getLogicalOperandCount(@Nullable PsiExpression condition)