docs: public static <T> List<T> collect(Iterator<T> iterator) {
          List<T> list = new ArrayList<T>();
          while (iterator.hasNext()) {
              list.add(iterator.next());
          }
          return list;
      }