docs: public List<T> peek(int max) throws IOException {
      int end = Math.min(max, size());
      List<T> subList = new ArrayList<T>(end);
      Iterator<T> iterator = iterator();
      for (int i = 0; i < end; i++) {
        subList.add(iterator.next());
      }
      return Collections.unmodifiableList(subList);
    }