private void assertTransform(String test, String expected, boolean capturing) throws SyntaxException, IOException {
RENode node = new REParser(test).parse();
REVisitor<RuntimeException> transformer = capturing ? new CaptureGroupTransformation() : new NonCaptureGroupTransformation();
node.accept(transformer);
StringBuilder sb = new StringBuilder();
RERenderer renderer = new RERenderer(sb);
node.accept(renderer);
assertEquals(expected, sb.toString());
}