code: public static <T> Collection<T> notEmpty(Collection<T> list, String name) {
          notNull(list, name);
          if (list.isEmpty()) {
              throw new IllegalArgumentException(String.format("Collection %s is empty", name));
          }
          return list;
      }
docs: Check that a list is not null and not empty.
  @param list the list of T.
  @param name parameter name for the exception message.