### Question:
Check { public static void that(boolean expression, String message) { that(expression, IS_TRUE, message); } private  Check(); @Nonnull static T notNull(T object, String fieldName); @Nonnull static String notNullOrEmpty(String string, String fieldName); @Nonnull static I notNullOrEmpty(I iterable, String fieldName); @Nonnull static C notNullOrEmpty(C collection, String fieldName); @Nonnull static M notNullOrEmpty(M map, String fieldName); static void that(boolean expression, String message); static void that(boolean expression, String messageFormat, Object arg1); static void that(boolean expression, String messageFormat, Object arg1, Object arg2); static void that(boolean expression, String messageFormat, Object arg1, Object arg2, Object arg3, Object... rest); static T that(T value, Predicate<? super T> predicate, String message); static T that(T value, Predicate<? super T> predicate, String messageFormat, Object arg1); static T that(T value, Predicate<? super T> predicate, String messageFormat, Object arg1, Object arg2); static T that(T value, Predicate<? super T> predicate, String messageFormat, Object arg1, Object arg2, Object arg3, Object... rest); static final String NOT_NULL_FMT; static final String NOT_EMPTY_FMT; static final Predicate<Boolean> IS_TRUE; static final Predicate<Object> NOT_NULL; static final Predicate<String> NOT_EMPTY_STRING; static final Predicate<Iterable<?>> NOT_EMPTY_ITERABLE; static final Predicate<Collection<?>> NOT_EMPTY_COLLECTION; static final Predicate<Map<?, ?>> NOT_EMPTY_MAP; }### Answer:
@Test public void that0() { Check.that(true, "should be true"); }
@Test public void that0_error() { try { Check.that(false, "should be true"); } catch (IllegalArgumentException e) { assertThat(e.getMessage()).isEqualTo("should be true"); } }
@Test public void that1() { Check.that(true, "%s should be true", "argument"); }
@Test public void that1_error() { try { Check.that(false, "%s should be true", "argument"); } catch (IllegalArgumentException e) { assertThat(e.getMessage()).isEqualTo("argument should be true"); } }
@Test public void that2() { Check.that(true, "%s %s be true", "argument", "should"); }
@Test public void that2_error() { try { Check.that(false, "%s %s be true", "argument", "should"); } catch (IllegalArgumentException e) { assertThat(e.getMessage()).isEqualTo("argument should be true"); } }
@Test public void that3() { Check.that(true, "%s %s %s true", "argument", "should", "be"); }
@Test public void that3_error() { try { Check.that(false, "%s %s %s true", "argument", "should", "be"); } catch (IllegalArgumentException e) { assertThat(e.getMessage()).isEqualTo("argument should be true"); } }
@Test public void that4() { Check.that(true, "%s %s %s %s", "argument", "should", "be", "true"); }
@Test public void that4_error() { try { Check.that(false, "%s %s %s %s", "argument", "should", "be", "true"); } catch (IllegalArgumentException e) { assertThat(e.getMessage()).isEqualTo("argument should be true"); } }