code: public static <T> Iterable<T> requireNonNullElements(Iterable<T> values, String name) {
          requireNonNull(values, name);
  
          int i = 0;
          for (T v : values) {
              if (v == null) {
                  throw new NullPointerException(name + '[' + i + ']');
              }
              i++;
          }
  
          return values;
      }
docs: Makes sure the specified {@code values} and all its elements are not {@code null}.