code: public final long count() {
          final AtomicLong result = new AtomicLong();
          toHandler(new Handler<T>() {
  
              private long count;
  
              @Override
              public void handle(final T element) {
                  if (element != null) {
                      ++this.count;
                  } else {
                      result.set(this.count);
                  }
  
              }
  
          });
          return result.get();
      }
docs: Terminal operation returning the number of elements in this Stream. Note that only few
  elements are materialized at any time, so it is safe to use this method with arbitrarily
  large Streams.
  
  @return the number of elements in this Stream