@CheckForNull
  static String checkEventCategory(@Nullable String category) {
    if (category == null) {
      return null;
    }
    checkArgument(category.length() <= MAX_CATEGORY_LENGTH, "Event category length (%s) is longer than the maximum authorized (%s). '%s' was provided.",
      category.length(), MAX_CATEGORY_LENGTH, category);
    return category;
  }
@Test
  void fail_if_category_longer_than_50() {
    assertThatThrownBy(() -> EventValidator.checkEventCategory(repeat("a", 50 + 1)))
      .isInstanceOf(IllegalArgumentException.class)
      .hasMessage("Event category length (51) is longer than the maximum authorized (50). " +
        "'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' was provided.");
  }