public static FilterPredicate invert(FilterPredicate pred) {
    Objects.requireNonNull(pred, "pred cannot be null");
    return pred.accept(INSTANCE);
  }
@Test
  public void testBaseCases() {
    assertEquals(notEq(intColumn, 17), invert(eq(intColumn, 17)));
    assertEquals(eq(intColumn, 17), invert(notEq(intColumn, 17)));
    assertEquals(gtEq(intColumn, 17), invert(lt(intColumn, 17)));
    assertEquals(gt(intColumn, 17), invert(ltEq(intColumn, 17)));
    assertEquals(ltEq(intColumn, 17), invert(gt(intColumn, 17)));
    assertEquals(lt(intColumn, 17), invert(gtEq(intColumn, 17)));

    FilterPredicate andPos = and(eq(intColumn, 17), eq(doubleColumn, 12.0));
    FilterPredicate andInv = or(notEq(intColumn, 17), notEq(doubleColumn, 12.0));
    assertEquals(andInv, invert(andPos));

    FilterPredicate orPos = or(eq(intColumn, 17), eq(doubleColumn, 12.0));
    FilterPredicate orInv = and(notEq(intColumn, 17), notEq(doubleColumn, 12.0));
    assertEquals(orPos, invert(orInv));

    assertEquals(eq(intColumn, 17), invert(not(eq(intColumn, 17))));

    UserDefined<Integer, DummyUdp> ud = userDefined(intColumn, DummyUdp.class);
    assertEquals(new LogicalNotUserDefined<>(ud), invert(ud));
    assertEquals(ud, invert(not(ud)));
    assertEquals(ud, invert(new LogicalNotUserDefined<>(ud)));
  }