@RequiresApi(Build.VERSION_CODES.R)
  @Override
  public boolean onInlineSuggestionsResponse(@NonNull InlineSuggestionsResponse response) {
    final List<InlineSuggestion> inlineSuggestions = response.getInlineSuggestions();

    if (inlineSuggestions.size() > 0) {
      mInlineSuggestionAction.onNewSuggestions(inlineSuggestions);
      getInputViewContainer().addStripAction(mInlineSuggestionAction, true);
      getInputViewContainer().setActionsStripVisibility(true);
    }

    return !inlineSuggestions.isEmpty();
  }
@Test
  public void testPrioritizePinnedSuggestions() {
    simulateOnStartInputFlow();
    var inlineView1 = Mockito.mock(InlineContentView.class);
    var inlineView2 = Mockito.mock(InlineContentView.class);
    var inlineView3Pinned = Mockito.mock(InlineContentView.class);
    var inlineView4 = Mockito.mock(InlineContentView.class);
    var inlineView5Pinned = Mockito.mock(InlineContentView.class);

    var response =
        mockResponse(inlineView1, inlineView2, inlineView3Pinned, inlineView4, inlineView5Pinned);
    var inlineSuggestion3 = response.getInlineSuggestions().get(2).getInfo();
    Mockito.doReturn(true).when(inlineSuggestion3).isPinned();
    var inlineSuggestion5 = response.getInlineSuggestions().get(4).getInfo();
    Mockito.doReturn(true).when(inlineSuggestion5).isPinned();

    mAnySoftKeyboardUnderTest.onInlineSuggestionsResponse(response);
    var rootView =
        mAnySoftKeyboardUnderTest
            .getInputViewContainer()
            .findViewById(R.id.inline_suggestions_strip_root);
    Shadows.shadowOf(rootView).getOnClickListener().onClick(rootView);
    var scroller =
        (ScrollViewAsMainChild)
            mAnySoftKeyboardUnderTest
                .getInputViewContainer()
                .findViewById(R.id.inline_suggestions_list);

    Assert.assertNotNull(scroller);
    Assert.assertEquals(5, scroller.getItemsCount());

    var itemsHolder = (ViewGroup) scroller.getChildAt(0);

    Assert.assertSame(inlineView3Pinned, itemsHolder.getChildAt(0));
    Assert.assertSame(inlineView5Pinned, itemsHolder.getChildAt(1));
    Assert.assertSame(inlineView1, itemsHolder.getChildAt(2));
    Assert.assertSame(inlineView2, itemsHolder.getChildAt(3));
    Assert.assertSame(inlineView4, itemsHolder.getChildAt(4));
  }