public static void checkNotNullAndNotEmpty(@Nullable String value, String propertyName) {
    Preconditions.checkNotNull(value, "Property '" + propertyName + "' cannot be null");
    Preconditions.checkArgument(
        !value.trim().isEmpty(), "Property '" + propertyName + "' cannot be an empty string");
  }
@Test
  public void testCheckNotEmpty_collectionFailEmpty() {
    try {
      Validator.checkNotNullAndNotEmpty(ImmutableList.of(), "test");
      Assert.fail();
    } catch (IllegalArgumentException iae) {
      Assert.assertEquals("Property 'test' cannot be an empty collection", iae.getMessage());
    }
  }