I'm processing a potentially infinite stream of data elements that follow the pattern:

`E1 <start mark>
E2 foo
E3 bah
 ...
En-1 bar
En <end mark>`

That is, a stream of <String>s, which must be accumulated in a buffer before I can map them to object model.

**Goal**: aggregate a `Stream<String>` into a `Stream<ObjectDefinedByStrings>` *without* the overhead of collecting on an infinite stream.

In english, the code would be something like "Once you see a start marker, start buffering. Buffer until you see an end marker, then get ready to return the old buffer, and prepare a fresh buffer. Return the old buffer."

My current implementation has the form:

```
Data<String>.stream()
            .map(functionReturningAnOptionalPresentOnlyIfObjectIsComplete)
            .filter(Optional::isPresent)

```

I have several questions:

1. What is this operation properly called? (i.e. what can I Google for more examples? Every discussion I find of `.map()` talks about 1:1 mapping. Every discussion of .reduce) talks about n:1 reduction. Every discussion of `.collect()` talks about accumulating as a terminal operation...)
2. This seems bad in many different ways. Is there a better way of implementing this? (A candidate of the form `.collectUntilConditionThenApplyFinisher(Collector,Condition,Finisher)`...?)

Thanks!