### Question:
PatternMatch { public static PatternMatch recursive(PatternMatch child) { return new PatternMatch(PatternType.PARENT_RECURSIVE, child); } private  PatternMatch(PatternType type, Object... args); @SuppressWarnings("unchecked") Map<String, CommonTree> match(CommonTree ct); static PatternMatch var(String name, PatternMatch p); static PatternMatch wild(); static PatternMatch kind(String k); static PatternMatch tuple(PatternMatch... tuple); PatternMatch child(PatternMatch child); PatternMatch nth(int n, PatternMatch child); static PatternMatch recursive(PatternMatch child); static PatternMatch or(PatternMatch... choice); static void replaceChildren(CommonTree dst, CommonTree src); static final Logger LOG; }### Answer:
@Test public void testRecursive() throws RecognitionException { CommonTree sink = FlumeBuilder .parseSink("let foo := < null ? [ console, { test => { test2 => { batch(10) => logicalNode(\"collector\") } } } ] > in foo"); LOG.info(sink.toStringTree()); PatternMatch pp = recursive(var("batchsize", kind("DEC"))); Map<String, CommonTree> m = pp.match(sink); assertNotNull(m); dumpMatches(m); LOG.info(m); pp = recursive(kind("SINK").child(var("LogicalNodeName", kind("STRING")))); m = pp.match(sink); assertNotNull(m); dumpMatches(m); LOG.info(m); }