XPathParser { protected ParenthesizedExpression parseParenthesizedExpr( TokenStream tokens ) { tokens.consume('('); if (tokens.canConsume(')')) { return new ParenthesizedExpression(); } Component expr = collapse(parseExpr(tokens)); tokens.consume(')'); return new ParenthesizedExpression(expr); } XPathParser( TypeSystem context ); Component parseXPath( String xpath );  }
@Test public void shouldParseParenthesizedExpression() { assertThat(parser.parseParenthesizedExpr(tokenize("('foo')")), is(paren(literal("foo")))); }