XPathParser { protected AnyKindTest parseAnyKindTest( TokenStream tokens ) { if (tokens.canConsume("node", "(", ")")) { return new AnyKindTest(); } return null; } XPathParser( TypeSystem context ); Component parseXPath( String xpath );  }
@Test public void shouldParseAnyKindTest() { assertThat(parser.parseAnyKindTest(tokenize("node()")), is(instanceOf(AnyKindTest.class))); }
@Test public void shouldReturnNullFromParseAnyKindTestIfNotFollowedByOpenAndCloseParenthesis() { assertThat(parser.parseAnyKindTest(tokenize("node x )")), is(nullValue())); assertThat(parser.parseAnyKindTest(tokenize("node(x )")), is(nullValue())); assertThat(parser.parseAnyKindTest(tokenize("node(x")), is(nullValue())); }