### Question:
Preconditions { public static void check(boolean expression) { check(expression, "The expression must not evaluate to false"); } private  Preconditions(); static T notNull(T object); static T notNull(T object, String message); static T notNull(T object, Supplier<String> messageSupplier); static Collection<T> doesNotContainNull(Collection<T> collection); static Collection<T> doesNotContainNull(Collection<T> collection, String message); static Collection<T> doesNotContainNull(Collection<T> collection, Supplier<String> messageSupplier); static void check(boolean expression); static void check(boolean expression, String message); static void check(boolean expression, Supplier<String> messageSupplier);  }### Answer:
@Test void checkThrowsExceptionIfFalse() { assertThrows(IllegalArgumentException.class, () -> Preconditions.check(false)); }
@Test void checkThrowsExceptionWithGivenMessageIfFalse() { final Throwable throwable = assertThrows(IllegalArgumentException.class, () -> Preconditions.check(false, "test")); assertEquals("test", throwable.getMessage()); }
@Test void checkEvaluatesSupplier() { final Throwable throwable = assertThrows(IllegalArgumentException.class, () -> Preconditions.check(false, () -> "test")); assertEquals("test", throwable.getMessage()); }
@Test void checkDoesNotThrowExceptionIfTrue() { Preconditions.check(true); }