@Override
  public void run() {
    try {
      String line;
      while ((line = reader.readLine()) != null) {
        lineCount++;
        consumer.accept(line);
      }

      // EOF
      reader.close();
    } catch (IOException streamClosed) {
      streamClosedStack = streamClosed;
    }
  }
Reads the output from a process stream and stores it for test validation.
<p>
Extracted from ProcessWrapper.
geode-junit/src/main/java/org/apache/geode/test/process/ProcessStreamReader.java