code: public <R> Stream<R> map(Function<? super T, ? extends R> mapper) {
          List<R> list = new ArrayList<R>();
          while (iterator.hasNext()) {
              list.add(mapper.apply(iterator.next()));
          }
          return Stream.of(list);
      }
docs: Returns a stream consisting of the results of applying the given function to the elements of this stream.
  
  @param mapper function to apply to each element
  @param <R>    The element type of the new stream
  @return the new stream