void (final String text, final List<String> expected) { final ArrayList<String> tokens = new ArrayList<>(); new DelimitedListProcessor(";") { @Override protected void processToken(final int start, final int end, final boolean delimitersOnly) { tokens.add(text.substring(start, end)); } }.processText(text); assertEquals(expected, tokens); }