code: public Stream<T> filter(final Func1<? super T, Boolean> func) {
          return new Stream<T>() {
              @Override
              public Iterator<T> iterator() {
                  return new ReadOnlyIterator<T>() {
  
                      Iterator<? extends T> iterator = Stream.this.iterator();
                      T next;
                      boolean hasNext;
  
                      private void process() {
                          while (!hasNext && iterator.hasNext()) {
                              final T n = iterator.next();
                              if (func.call(n)) {
                                  next = n;
                                  hasNext = true;
                              }
                          }
                      }
  
                      @Override
                      public boolean hasNext() {
                          process();
                          return hasNext;
                      }
  
                      @Override
                      public T next() {
                          process();
                          hasNext = false;
                          return next;
                      }
                  };
              }
          };
      }
docs: Returns a new stream that contains all items of the current stream for which a given function returned {@link Boolean#TRUE}.
  
  @param func a function to call for each item.
  @return a new stream that contains all items of the current stream for which a given function returned {@link Boolean#TRUE}.