public void addStripAction(@NonNull StripActionProvider provider, boolean highPriority) {
    for (var stripActionView : mStripActionViews) {
      if (stripActionView.getTag(PROVIDER_TAG_ID) == provider) {
        return;
      }
    }

    var actionView = provider.inflateActionView(this);
    if (actionView.getParent() != null)
      throw new IllegalStateException("StripActionProvider inflated a view with a parent!");
    actionView.setTag(PROVIDER_TAG_ID, provider);
    if (mShowActionStrip) {
      if (highPriority) {
        addView(actionView, FIRST_PROVIDER_VIEW_INDEX);
      } else {
        addView(actionView);
      }
    }

    if (highPriority) {
      mStripActionViews.add(0, actionView);
    } else {
      mStripActionViews.add(actionView);
    }

    invalidate();
  }
@Test
  public void testHighBothPriority() {
    View view = new View(mUnderTest.getContext());
    View view2 = new View(mUnderTest.getContext());
    KeyboardViewContainerView.StripActionProvider provider =
        Mockito.mock(KeyboardViewContainerView.StripActionProvider.class);
    Mockito.doReturn(view).when(provider).inflateActionView(any());
    KeyboardViewContainerView.StripActionProvider provider2 =
        Mockito.mock(KeyboardViewContainerView.StripActionProvider.class);
    Mockito.doReturn(view2).when(provider2).inflateActionView(any());

    mUnderTest.addStripAction(provider, true);
    Assert.assertEquals(3, mUnderTest.getChildCount());
    Assert.assertSame(view, mUnderTest.getChildAt(2));

    mUnderTest.addStripAction(provider2, true);
    Assert.assertEquals(4, mUnderTest.getChildCount());
    Assert.assertSame(view2, mUnderTest.getChildAt(2));
    Assert.assertSame(view, mUnderTest.getChildAt(3));
  }