docs: public static <T> List<T> toList(Iterator<T> self) {
          List<T> answer = new ArrayList<T>();
          while (self.hasNext()) {
              answer.add(self.next());
          }
          return answer;
      }