admobadapter/src/main/java/com/clockbyte/admobadapter/AdmobAdapterCalculator.java
public int getAdsCountToPublish(int fetchedAdsCount, int sourceItemsCount){
        if(fetchedAdsCount <= 0 || getNoOfDataBetweenAds() <= 0) return 0;
        int expected = 0;
        if(sourceItemsCount > 0 && sourceItemsCount >= getOffsetValue()+1)
            expected = (sourceItemsCount - getOffsetValue()) / getNoOfDataBetweenAds() + 1;
        expected = Math.max(0, expected);
        expected = Math.min(fetchedAdsCount, expected);
        return Math.min(expected, getLimitOfAds());
    }
public int getAdsCountToPublish(int fetchedAdsCount, int sourceItemsCount){
        if(fetchedAdsCount <= 0 || getNoOfDataBetweenAds() <= 0) return 0;
        int expected = 0;
        if(sourceItemsCount > 0 && sourceItemsCount >= getOffsetValue()+1)
            expected = (sourceItemsCount - getOffsetValue()) / getNoOfDataBetweenAds() + 1;
        expected = Math.max(0, expected);
        expected = Math.min(fetchedAdsCount, expected);
        return Math.min(expected, getLimitOfAds());
    }
Gets the count of ads that could be published

@param fetchedAdsCount the count of completely fetched ads that are ready to be published
@param sourceItemsCount the count of items in the source collection
@return the original position that the adapter position would have been without ads