@Override
    public Object instantiateItem(ViewGroup container, int position) {
        if(getRealCount() == 0){
            return null;
        }
        int virtualPosition = position % getRealCount();
        debug("instantiateItem: real position: " + position);
        debug("instantiateItem: virtual position: " + virtualPosition);

        // only expose virtual position to the inner adapter
        return adapter.instantiateItem(container, virtualPosition);
    }
@return the {@link #getCount()} result of the wrapped adapter
library/src/main/java/com/daimajia/slider/library/Tricks/InfinitePagerAdapter.java