RegexParserTransformer t = new RegexParserTransformer();
t.column = col;
t.pattern = Pattern.compile("(a+)(b+)|(c+)");
OutputColumns outputColumns = t.getOutputColumns();
assertEquals(4, outputColumns.getColumnCount());
assertEquals("foobar (matched part)", outputColumns.getColumnName(0));
assertEquals("foobar (group 1)", outputColumns.getColumnName(1));
assertEquals("foobar (group 2)", outputColumns.getColumnName(2));
assertEquals("foobar (group 3)", outputColumns.getColumnName(3));
assertArrayEquals(new String[] { "aabb", "aa", "bb", null }, t.transform(new MockInputRow().put(col, "aabb")));
assertArrayEquals(new String[] { "cccc", null, null, "cccc" }, t.transform(new MockInputRow().put(col, "cccc")));
assertArrayEquals(new String[] { null, null, null, null }, t.transform(new MockInputRow().put(col, "dddd")));
}