### Question:
Check { @Nonnull public static String notNullOrEmpty(String string, String fieldName) { notNull(string, fieldName); return that(string, NOT_EMPTY_STRING, NOT_EMPTY_FMT, fieldName); } 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 notNullOrEmptyString() { String result = Check.notNullOrEmpty("result", "field"); assertThat(result).isEqualTo("result"); }
@Test public void notNullOrEmptyIterable() { Iterable<String> input = ImmutableList.of("value"); Iterable<String> result = Check.notNullOrEmpty(input, "field"); assertThat(result).isEqualTo(input); }
@Test public void notNullOrEmptyCollection() { List<String> input = ImmutableList.of("value"); List<String> result = Check.notNullOrEmpty(input, "field"); assertThat(result).isEqualTo(input); }
@Test public void notNullOrEmptyMap() { Map<String, String> input = com.google.common.collect.ImmutableMap.of("key", "value"); Map<String, String> result = Check.notNullOrEmpty(input, "field"); assertThat(result).isEqualTo(input); }