### Question:
Validator { public static void checkNullOrNotEmpty(@Nullable String value, String propertyName) { if (value == null) { return; } Preconditions.checkArgument( !value.trim().isEmpty(), "Property '" + propertyName + "' cannot be an empty string"); }  static void checkNotNullAndNotEmpty(@Nullable String value, String propertyName); static void checkNullOrNotEmpty(@Nullable String value, String propertyName); static void checkNotNullAndNotEmpty(@Nullable Collection<?> value, String propertyName); static void checkNullOrNonNullNonEmptyEntries(
      @Nullable Collection<String> values, String propertyName); static void checkNullOrNonNullNonEmptyEntries(
      @Nullable Map<String, String> values, String propertyName); static void checkNullOrNonNullEntries(
      @Nullable Collection<?> values, String propertyName); static void checkEquals(
      @Nullable String value, String propertyName, String expectedValue);  }### Answer:
@Test public void testCheckNullOrNotEmpty_valuePass() { Validator.checkNullOrNotEmpty("value", "test"); }
@Test public void testCheckNullOrNotEmpty_nullPass() { Validator.checkNullOrNotEmpty(null, "test"); }
@Test public void testCheckNullOrNotEmpty_fail() { try { Validator.checkNullOrNotEmpty(" ", "test"); Assert.fail(); } catch (IllegalArgumentException iae) { Assert.assertEquals("Property 'test' cannot be an empty string", iae.getMessage()); } }