### Question:
XPathParser { protected FunctionCall parseFunctionCall( TokenStream tokens ) { NameTest name = parseQName(tokens); tokens.consume("("); List<Component> args = new ArrayList<Component>(); if (!tokens.matches(')')) { do { args.add(collapse(parseExprSingle(tokens))); } while (tokens.canConsume(",")); tokens.consume(")"); } return new FunctionCall(name, args); } XPathParser( TypeSystem context ); Component parseXPath( String xpath );  }### Answer:
@Test public void shouldParseFunctionCallWithZeroParameters() { FunctionCall func = parser.parseFunctionCall(tokenize("a()")); assertThat(func, is(notNullValue())); assertThat(func.getName(), is(nameTest("a"))); assertThat(func.getParameters().isEmpty(), is(true)); }
@Test public void shouldParseFunctionCallWithOneQuotedStringLiteralParameter() { FunctionCall func = parser.parseFunctionCall(tokenize("a('foo')")); assertThat(func, is(notNullValue())); assertThat(func.getName(), is(nameTest("a"))); assertThat(func.getParameters().size(), is(1)); assertThat(func.getParameters().get(0), is((Component)literal("foo"))); }
@Test public void shouldParseFunctionCallWithOneUnquotedStringLiteralParameter() { FunctionCall func = parser.parseFunctionCall(tokenize("a(foo)")); assertThat(func, is(notNullValue())); assertThat(func.getName(), is(nameTest("a"))); assertThat(func.getParameters().size(), is(1)); assertThat(func.getParameters().get(0), is((Component)nameTest("foo"))); }