@Override
  public void showPreviewForKey(
      Keyboard.Key key, Drawable icon, View parentView, PreviewPopupTheme previewPopupTheme) {
    KeyPreview popup = getPopupForKey(key, parentView, previewPopupTheme);
    Point previewPosition =
        mPositionCalculator.calculatePositionForPreview(
            key, previewPopupTheme, getLocationInWindow(parentView));
    popup.showPreviewForKey(key, icon, previewPosition);
  }
@Test
  public void testCycleThroughPopupQueueWhenAllAreActive() {
    KeyPreviewsManager underTest =
        new KeyPreviewsManager(getApplicationContext(), mPositionCalculator, 3);

    final int[] reuseIndex = new int[] {0, 1, 2, 0, 1, 2, 0};
    final List<TextView> usedWindows = new ArrayList<>();

    for (int index = 0; index < reuseIndex.length; index++) {
      underTest.showPreviewForKey(mTestKeys[index], mTestKeys[index].label, mKeyboardView, mTheme);

      usedWindows.add(
          getLatestCreatedPopupWindow().getContentView().findViewById(R.id.key_preview_text));
      final TextView textView = usedWindows.get(reuseIndex[index]);
      Assert.assertEquals(textView.getText().toString(), mTestKeys[index].label);
    }
  }