@Override
  public void onKey(
      int primaryCode, Keyboard.Key key, int multiTapIndex, int[] nearByKeyCodes, boolean fromUI) {
    mParentListener.listener().onKey(primaryCode, key, multiTapIndex, nearByKeyCodes, fromUI);
    if ((mInOneShot && primaryCode != KeyCodes.DELETE) || primaryCode == KeyCodes.ENTER) {
      mKeyboardDismissAction.run();
    }
  }
@Test
  public void testOnKeyOnEnter() {
    final AnyKeyboard.AnyKey key = Mockito.mock(AnyKeyboard.AnyKey.class);
    final int[] nearByKeyCodes = {3};
    mUnderTest.onKey(KeyCodes.ENTER, key, 2, nearByKeyCodes, true);
    final InOrder inOrder = Mockito.inOrder(mMockParentListener, mMockKeyboardDismissAction);
    inOrder
        .verify(mMockParentListener)
        .onKey(
            Mockito.eq(KeyCodes.ENTER),
            Mockito.same(key),
            Mockito.eq(2),
            Mockito.same(nearByKeyCodes),
            Mockito.eq(true));
    inOrder.verify(mMockKeyboardDismissAction).run();
    inOrder.verifyNoMoreInteractions();
  }