### Question:
Validator implements Predicate<T> { public final T validate(final T argument) { if (!test(argument)) throw new IllegalArgumentException(invalidMessage(argument)); return argument; }  final T validate(final T argument); String invalidMessage(final T argument); final Validator<T> and(final Validator<T> other); final Validator<T> or(final Validator<T> other); final Validator<T> not();  }### Answer:
@Test public void testValidate_Success() { assertEquals("correct", v.validate("correct")); }
@Test(expected = IllegalArgumentException.class) public void testValidate_Failure() { v.validate("incorrect"); }