void (boolean showSpyOutput, String[] text, String expected) { StringBuilder actual = new StringBuilder(); MavenSimpleConsoleEventsBuffer buffer = new MavenSimpleConsoleEventsBuffer((l, k) -> actual.append(l), showSpyOutput); for (String s : text) { buffer.addText(s, Key.create("test")); } assertEquals(expected, actual.toString()); }