code: public static void notEmpty(Collection collection, String name) {
      notNull(collection, name);
  
      if (collection.isEmpty()) {
        throw new IllegalArgumentException(name + " must not be empty");
      }
    }
docs: Checks that a given collection is not null and not empty.
  
  @param collection    The collection to check
  @param name The name of the collection to use when raising an error.
  @throws IllegalArgumentException If the collection was null or empty.