public static void validate(FilterPredicate predicate, MessageType schema) {
    Objects.requireNonNull(predicate, "predicate cannot be null");
    Objects.requireNonNull(schema, "schema cannot be null");
    predicate.accept(new SchemaCompatibilityValidator(schema));
  }
@Test
  public void testNonRepeatedNotSupportedForContainsPredicates() {
    try {
      validate(contains(eq(longBar, 10L)), schema);
      fail("Non-repeated field " + longBar + " should fail to validate a containsEq() predicate");
    } catch (IllegalArgumentException e) {
      assertEquals(
          "FilterPredicate for column x.bar requires a repeated schema, but found max repetition level 0",
          e.getMessage());
    }
  }