spyglass/src/main/java/com/linkedin/android/spyglass/ui/MentionsEditText.java
public void insertMention(@NonNull Mentionable mention) {
        if (mTokenizer == null) {
            return;
        }

        // Setup variables and ensure they are valid
        Editable text = getEditableText();
        int cursor = getSelectionStart();
        int start = mTokenizer.findTokenStart(text, cursor);
        int end = mTokenizer.findTokenEnd(text, cursor);
        if (start < 0 || start >= end || end > text.length()) {
            return;
        }

        insertMentionInternal(mention, text, start, end);
    }
public void insertMention(@NonNull Mentionable mention) {
        if (mTokenizer == null) {
            return;
        }

        // Setup variables and ensure they are valid
        Editable text = getEditableText();
        int cursor = getSelectionStart();
        int start = mTokenizer.findTokenStart(text, cursor);
        int end = mTokenizer.findTokenEnd(text, cursor);
        if (start < 0 || start >= end || end > text.length()) {
            return;
        }

        insertMentionInternal(mention, text, start, end);
    }
Inserts a mention into the token being considered currently.

@param mention {@link Mentionable} to insert a span for