code: static String getIdAttributeValidationExpression() {
      String isIdIsTrue = "$('" + IS_ID_ATTRIBUTE + "').eq(true)";
      String isIdIsFalseOrNull =
          "$('" + IS_ID_ATTRIBUTE + "').eq(false).or($('" + IS_ID_ATTRIBUTE + "').isNull())";
  
      // Use the valid ID attribute types to constuct the validation expression
      List<String> typeExpressions =
          getValidIdAttributeTypes()
              .stream()
              .map(attributeType -> "$('" + TYPE + "').eq('" + getValueString(attributeType) + "')")
              .collect(Collectors.toList());
  
      boolean first = true;
      StringBuilder typeIsNullOrStringOrIntOrLong = new StringBuilder();
      for (String expression : typeExpressions) {
        if (first) {
          typeIsNullOrStringOrIntOrLong.append(expression);
          first = false;
          continue;
        }
        typeIsNullOrStringOrIntOrLong.append(".or(").append(expression).append(")");
      }
      typeIsNullOrStringOrIntOrLong.append(".or($('" + TYPE + "').isNull())");
  
      String nullableIsFalse = "$('" + IS_NULLABLE + "').eq(false)";
  
      return isIdIsFalseOrNull
          + ".or("
          + isIdIsTrue
          + ".and("
          + typeIsNullOrStringOrIntOrLong
          + ").and("
          + nullableIsFalse
          + ")).value()";
    }
docs: Package private for testability