IntersectionParser extends AbstractRegexParser { @Override public void parse(ParseContext parseContext) { Chunk currentChunk = parseContext.getCurrent(); Matcher matcher = INTERSECTION.matcher(currentChunk.getText()); if(!matcher.matches()) { patternNotMatched(parseContext,INTERSECTION); return; } MatchBuilder builder = new MatchBuilder() .add(matcher) .add(MatchType.COMPLETE) .add(parseContext) .add(INTERSECTION, 1, TokenType.CROSS_STREET_ONE) .add(INTERSECTION, 2, TokenType.AND) .add(INTERSECTION, 3, TokenType.CROSS_STREET_TWO); handleMatch(builder.build(), ChunkType.INTERSECTION); }  @Override void parse(ParseContext parseContext);  }
@Test public void testParse() { testParser(this.parser, LOGGER); }