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 testTwiceDeclaredColumn() {
    validate(eq(stringC, Binary.fromString("larry")), schema);

    try {
      validate(complexMixedType, schema);
      fail("this should throw");
    } catch (IllegalArgumentException e) {
      assertEquals(
          "Column: x.bar was provided with different types in the same predicate. Found both: (class java.lang.Integer, class java.lang.Long)",
          e.getMessage());
    }
  }