How to design a returned stream that may use skip
I have created a parsing library that accepts a provided input and returns a stream of Records. A program then calls this library and processes the results. In my case, my program is using something like recordStream.forEach(r -> insertIntoDB(r)); One of the types of input that can be provided to the parsing library is a flat file, which may have a header row. As such, the parsing library can be configured to skip a header row. If a header row is configured, it adds a skip(n) element to the return, e.g. Files.lines(input)**.skip(1)**.parallel().map(r -> createRecord(r)); The parsing library