code: public static <T> List<T> toList(Iterable<T> iter) {
      List<T> buf = new ArrayList<>();
      for (T v : iter) {
        buf.add(v);
      }
      return buf;
    }
docs: Returns a list with a copy of the data from the iterable.