LocationTokens { public Token firstTokenOfType(TokenType tokenType) { List<Token> tokens = tokensOfType(tokenType); if (tokens.isEmpty()) { return null; } return tokens.get(0); } LocationTokens(Input input, List<Chunk> chunks); List<Token> tokensOfType(TokenType... tokenTypes); Token firstTokenOfType(TokenType tokenType); Input getInput(); List<Chunk> getChunks(); List<Token> getTokens(); String parseSummary(); @Override String toString();  }
@Test public void testFirstTokenOfType() { assertThat(locationTokens.firstTokenOfType(TokenType.AND)).isNull(); assertThat(locationTokens.firstTokenOfType(TokenType.STREET_NAME)).isEqualTo(streetNameToken); }