void () { mySplitter = createEventSplitter(false, true); final ProcessOutputType stdout = ProcessOutputType.STDOUT; mySplitter.process("hello\r\n", stdout); mySplitter.process("world\r\n", stdout); final String message = ServiceMessage.asString("testStart", Collections.emptyMap()); mySplitter.process("\r\n" + message + "\r\n", stdout); mySplitter.process("hi", stdout); mySplitter.flush(); final String[] strings = myOutput.get(stdout).toArray(); Assert.assertArrayEquals(new String[]{"hello\r\n", "world\r\n", message + "\r\n", "hi"}, strings); }