ConvertingItemNavigator implements ItemNavigator<T_EXTERNAL> { @Override public T_EXTERNAL navigateTo(int itemPos) { if (queryNavigator.getCurrentItemIdx() != itemPos || currentItem == null) { currentItem = converter.toNavigatorItemType(queryNavigator.navigateTo(itemPos)); } return currentItem; } ConvertingItemNavigator(ItemNavigator<T_INTERNAL> queryNavigator, Converter<T_EXTERNAL, T_INTERNAL> converter); @Override T_EXTERNAL navigateTo(int itemPos); @Override T_EXTERNAL getCurrentItem(); @Override int getNumOfItems(); @Override int getCurrentItemIdx(); @Override void clearCaches();  }
@Test public void testNavigateTo() { assertEquals("22", convertingNavigator.navigateTo(3)); assertEquals(Integer.valueOf(22), intNavigator.getCurrentItem()); assertEquals(1, toNavigatorItemTypeCallCount); }