MentionsEditText extends EditText implements TokenSource { public void insertMentionWithoutToken(@NonNull Mentionable mention) { Editable text = getEditableText(); int index = getSelectionStart(); index = index > 0 ? index : 0; insertMentionInternal(mention, text, index, index); } MentionsEditText(@NonNull Context context);  MentionsEditText(@NonNull Context context, @Nullable AttributeSet attrs);  MentionsEditText(@NonNull Context context, @Nullable AttributeSet attrs, int defStyle); @Override @NonNull String getCurrentTokenString(); @Override @Nullable QueryToken getQueryTokenIfValid(); @Override boolean onTouchEvent(@NonNull MotionEvent event); @Override boolean onTextContextMenuItem(@MenuRes int id); @NonNull String getCurrentKeywordsString(); void updateSpan(@NonNull MentionSpan span); void deselectAllSpans(); void insertMention(@NonNull Mentionable mention); void insertMentionWithoutToken(@NonNull Mentionable mention); boolean isCurrentlyExplicit(); @Override void onPopulateAccessibilityEvent(@NonNull AccessibilityEvent event); @Override void addTextChangedListener(@NonNull TextWatcher watcher); @Override void removeTextChangedListener(@NonNull TextWatcher watcher); @SuppressWarnings("unused") void addMentionWatcher(@NonNull MentionWatcher watcher); @SuppressWarnings("unused") void removeMentionWatcher(@NonNull MentionWatcher watcher); @NonNull MentionsEditable getMentionsText(); @Nullable Tokenizer getTokenizer(); void setTokenizer(@Nullable final Tokenizer tokenizer); void setQueryTokenReceiver(@Nullable final QueryTokenReceiver queryTokenReceiver); void setSuggestionsVisibilityManager(@Nullable final SuggestionsVisibilityManager suggestionsVisibilityManager); void setMentionSpanFactory(@NonNull final MentionSpanFactory factory); void setMentionSpanConfig(@NonNull final MentionSpanConfig config); void setAvoidedPrefix(@Nullable String prefix); void setAvoidPrefixOnTap(boolean avoidPrefixOnTap); @NonNull @Override Parcelable onSaveInstanceState(); @Override void onRestoreInstanceState(Parcelable state);  }
@Test public void testInsertMentionWithoutToken() { Mentionable mention = new TestMention("FirstName MiddleName LastName"); mEditText.insertMentionWithoutToken(mention); assertEquals("FirstName MiddleName LastName", mEditText.getText().toString()); Editable editable = mEditText.getEditableText(); editable.append(" hello "); mention = new TestMention("New Mention"); mEditText.insertMentionWithoutToken(mention); assertEquals("FirstName MiddleName LastName hello New Mention", mEditText.getText().toString()); }