CollectingLogOutputStream extends LogOutputStream { @Override protected void processLine(String line, int level) { Lock lock = new ReentrantLock(); lock.lock(); String[] splitLines = line.split("\r"); for(String lineSegment: splitLines){ lines.add(lineSegment); } lock.unlock(); }  String getAllLinesAsString(); List<String> getLastNLines(int n);  }
@Test public void testProcessLine() { CollectingLogOutputStream instance = new CollectingLogOutputStream(); instance.processLine("add a line of output", 1); }