### Question:
EmojiTextViewHelper { @NonNull public InputFilter[] getFilters(@NonNull final InputFilter[] filters) { return mHelper.getFilters(filters); } EmojiTextViewHelper(@NonNull TextView textView); void updateTransformationMethod(); @NonNull InputFilter[] getFilters(@NonNull final InputFilter[] filters); @Nullable TransformationMethod wrapTransformationMethod(
            @Nullable TransformationMethod transformationMethod); void setAllCaps(boolean allCaps);  }### Answer:
@Test public void testGetFilters() { final InputFilter existingFilter = mock(InputFilter.class); final InputFilter[] filters = new InputFilter[]{existingFilter}; final InputFilter[] newFilters = mTextViewHelper.getFilters(filters); assertEquals(2, newFilters.length); assertThat(Arrays.asList(newFilters), hasItem(existingFilter)); assertNotNull(findEmojiInputFilter(newFilters)); }
@Test public void testGetFilters_doesNotAddSecondInstance() { final InputFilter existingFilter = mock(InputFilter.class); final InputFilter[] filters = new InputFilter[]{existingFilter}; InputFilter[] newFilters = mTextViewHelper.getFilters(filters); EmojiInputFilter emojiInputFilter = findEmojiInputFilter(newFilters); assertNotNull(emojiInputFilter); newFilters = mTextViewHelper.getFilters(newFilters); assertEquals(2, newFilters.length); assertThat(Arrays.asList(newFilters), hasItem(existingFilter)); assertThat(Arrays.asList(newFilters), hasItem(emojiInputFilter)); }