class TreeMetaDataProvider {

  public void updateTokenType(Token token, Token.Type newType) {
    int tokenIndex = indexOfFirstToken(token.textRange());
    if (!isExistingToken(token, tokenIndex)) {
      throw new IllegalArgumentException("token '" + token.text() + "' not found in metadata, " + token.textRange());
    }
    this.sortedTokens.set(tokenIndex, new TokenImpl(token.textRange(), token.text(), newType));
  }

  public  TreeMetaDataProvider(List<Comment> comments, List<Token> tokens);

}