def generate_final_vocabulary(reserved_tokens, char_tokens, curr_tokens):
    """Generates final vocab given reserved, single-character, and current tokens.
    Args:
      reserved_tokens: list of strings (tokens) that must be included in vocab
      char_tokens: set of single-character strings
      curr_tokens: string to int dict mapping token to count
    Returns:
      list of strings representing final vocabulary
    """

    sorted_char_tokens = sorted(list(char_tokens))
    vocab_char_arrays = []
    vocab_char_arrays.extend(reserved_tokens)
    vocab_char_arrays.extend(sorted_char_tokens)

    # Sort by count, then alphabetically.
    sorted_tokens = sorted(sorted(curr_tokens.items(), key=lambda x: x[0]),
                           key=lambda x: x[1], reverse=True)
    for token, _ in sorted_tokens:
        vocab_char_arrays.append(token)

    seen_tokens = set()
    # Adding unique tokens to list to maintain sorted order.
    vocab_words = []
    for word in vocab_char_arrays:
        if word in seen_tokens:
            continue
        seen_tokens.add(word)
        vocab_words.append(word)

    return vocab_words