### Question:
EmojiExtractTextLayout extends LinearLayout { public int getEmojiReplaceStrategy() { return mExtractEditText.getEmojiReplaceStrategy(); } EmojiExtractTextLayout(Context context);  EmojiExtractTextLayout(Context context,
            @Nullable AttributeSet attrs);  EmojiExtractTextLayout(Context context,
            @Nullable AttributeSet attrs, int defStyleAttr); @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)  EmojiExtractTextLayout(Context context, AttributeSet attrs,
            int defStyleAttr, int defStyleRes); void setEmojiReplaceStrategy(@EmojiCompat.ReplaceStrategy int replaceStrategy); int getEmojiReplaceStrategy(); void onUpdateExtractingViews(InputMethodService inputMethodService, EditorInfo ei);  }### Answer:
@Test @UiThreadTest @SdkSuppress(minSdkVersion = 19) public void testSetEmojiReplaceStrategyCallEmojiCompatWithCorrectStrategy() { final Context context = InstrumentationRegistry.getTargetContext(); final EmojiExtractTextLayout layout = (EmojiExtractTextLayout) LayoutInflater.from(context) .inflate(androidx.emoji.test.R.layout.extract_view_with_attrs, null); final EmojiExtractEditText extractEditText = layout.findViewById( android.R.id.inputExtractEditText); assertNotNull(layout); assertNotNull(extractEditText); assertEquals(EmojiCompat.REPLACE_STRATEGY_NON_EXISTENT, layout.getEmojiReplaceStrategy()); final EmojiCompat emojiCompat = mock(EmojiCompat.class); when(emojiCompat.getLoadState()).thenReturn(EmojiCompat.LOAD_STATE_SUCCEEDED); EmojiCompat.reset(emojiCompat); final String testString = "anytext"; extractEditText.setText(testString); verify(emojiCompat, times(1)).process(sameCharSequence(testString), anyInt(), anyInt(), anyInt(), eq(EmojiCompat.REPLACE_STRATEGY_NON_EXISTENT)); }