NegateUtil { public static <T> ToBoolean<T> negateBoolean(ToBoolean<T> expression) { class NegateBoolean extends AbstractNegate<T, ToBoolean<T>> implements ToBoolean<T> { private NegateBoolean(ToBoolean<T> inner) { super(inner); } @Override public boolean applyAsBoolean(T object) { return !inner.applyAsBoolean(object); } } return new NegateBoolean(expression); } private  NegateUtil(); static ToByte<T> negateByte(ToByte<T> expression); static ToShort<T> negateShort(ToShort<T> expression); static ToInt<T> negateInt(ToInt<T> expression); static ToLong<T> negateLong(ToLong<T> expression); static ToFloat<T> negateFloat(ToFloat<T> expression); static ToDouble<T> negateDouble(ToDouble<T> expression); static ToBigDecimal<T> negateBigDecimal(ToBigDecimal<T> expression); static ToBoolean<T> negateBoolean(ToBoolean<T> expression); static ToByteNullable<T> negateByteOrNull(ToByteNullable<T> expression); static ToShortNullable<T> negateShortOrNull(ToShortNullable<T> expression); static ToIntNullable<T> negateIntOrNull(ToIntNullable<T> expression); static ToLongNullable<T> negateLongOrNull(ToLongNullable<T> expression); static ToFloatNullable<T> negateFloatOrNull(ToFloatNullable<T> expression); static ToDoubleNullable<T> negateDoubleOrNull(ToDoubleNullable<T> expression); static ToBooleanNullable<T> negateBooleanOrNull(ToBooleanNullable<T> expression);  }
@Test void negateBoolean() { final ToBoolean<Boolean> toBoolean = NegateUtil.negateBoolean(b -> b); assertFalse(toBoolean.applyAsBoolean(true)); assertTrue(toBoolean.applyAsBoolean(false)); }