SingleFieldSearchParser implements LocationTokenizer { @Override public LocationTokens parse(Input input) { ParseContext parseContext = new ParseContext(input); for (Parser parser : this.parsers) { parser.parse(parseContext); if(parseContext.isParsed()) { break; } } return new LocationTokens(input, parseContext.getChunks()); } SingleFieldSearchParser(List<Parser> parsers); @Override LocationTokens parse(Input input);  }
@Test public void testParse() { List<ChunkSpec> specs = specBuilder.getSpecs("AllParsers"); assertThat(specs.isEmpty()).isFalse(); for (ChunkSpec spec : specs) { logSpecStart(LOGGER, spec); Input input = spec.input(); LocationTokens locationTokens = this.parser.parse(input); assertChunksEquals(spec.getId(), spec.getChunks(), locationTokens.getChunks(), LOGGER); } }