public static void checkNullOrNonNullNonEmptyEntries(
      @Nullable Collection<String> values, String propertyName) {
    if (values == null) {
      // pass
      return;
    }
    for (String value : values) {
      Preconditions.checkNotNull(
          value, "Property '" + propertyName + "' cannot contain null entries");
      Preconditions.checkArgument(
          !value.trim().isEmpty(), "Property '" + propertyName + "' cannot contain empty strings");
    }
  }
Check if a collection is either null, empty or contains only non-null, non-empty values.

@param values the collection in question
@param propertyName the equivalent 'yaml' property name
@throws IllegalArgumentException if {@code values} contains empty entries
@throws NullPointerException if {@code values} contains null entries
jib-cli/src/main/java/com/google/cloud/tools/jib/cli/buildfile/Validator.java