void (String[] text, String[] expected) { List<String> actual = new ArrayList<>(); MavenSpyEventsBuffer spyEventsBuffer = new MavenSpyEventsBuffer((l, k) -> actual.add(l)); for (String s : text) { spyEventsBuffer.addText(s, Key.create("test")); } assertOrderedEquals(actual, expected); }