Source:
private Iterable<CachePagesListView> pagesListViewSupplier(Map<String, Object> filter) { Object cacheGrpId = filter == null ? null : filter.get(CachePagesListViewWalker.CACHE_GROUP_ID_FILTER); Collection<CacheGroupContext> cacheGrps; if (cacheGrpId instanceof Integer) { CacheGroupContext cacheGrp = this.cacheGrps.get(cacheGrpId); if (cacheGrp == null) return Collections.emptyList(); cacheGrps = Collections.singletonList(cacheGrp); } else cacheGrps = this.cacheGrps.values(); Object partFilter = filter == null ? null : filter.get(CachePagesListViewWalker.PARTITION_ID_FILTER); Integer partId = partFilter instanceof Integer ? (Integer)partFilter : null; Object bucketFilter = filter == null ? null : filter.get(CachePagesListViewWalker.BUCKET_NUMBER_FILTER); Integer bucketNum = bucketFilter instanceof Integer ? (Integer)bucketFilter : null; return F.flat( F.iterator( (Iterable<IgniteCacheOffheapManager.CacheDataStore>)F.flat( F.iterator(cacheGrps, grp -> grp.offheap().cacheDataStores(), true) ), dataStore -> { RowStore rowStore = dataStore.rowStore(); if (rowStore == null || !(dataStore instanceof GridCacheOffheapManager.GridCacheDataStore)) return Collections.emptySet(); PagesList pagesList = (PagesList)rowStore.freeList(); if (bucketNum != null) { return bucketNum >= 0 && bucketNum < pagesList.bucketsCount() ? Collections.singleton(new CachePagesListView(pagesList, bucketNum, dataStore.partId())) : Collections.emptyList(); } return IntStream.range(0, pagesList.bucketsCount()) .mapToObj(bucket -> new CachePagesListView(pagesList, bucket, dataStore.partId())) .collect(Collectors.toList()); }, true, cacheDataStore -> partId == null || cacheDataStore.partId() == partId)); }

Target:
private Iterable<CachePagesListView> pagesListViewSupplier(Map<String, Object> filter) { Integer cacheGrpId = (Integer)filter.get(CachePagesListViewWalker.CACHE_GROUP_ID_FILTER); Collection<CacheGroupContext> cacheGrps; if (cacheGrpId != null) { CacheGroupContext cacheGrp = this.cacheGrps.get(cacheGrpId); if (cacheGrp == null) return Collections.emptyList(); cacheGrps = Collections.singletonList(cacheGrp); } else cacheGrps = this.cacheGrps.values(); Integer partId = (Integer)filter.get(CachePagesListViewWalker.PARTITION_ID_FILTER); Integer bucketNum = (Integer)filter.get(CachePagesListViewWalker.BUCKET_NUMBER_FILTER); Iterable<IgniteCacheOffheapManager.CacheDataStore> dataStores = F.flat(F.iterator(cacheGrps, grp -> grp.offheap().cacheDataStores(), true)); return F.flat(F.iterator(dataStores, dataStore -> { RowStore rowStore = dataStore.rowStore(); if (rowStore == null || !(dataStore instanceof GridCacheOffheapManager.GridCacheDataStore)) return Collections.emptySet(); PagesList pagesList = (PagesList)rowStore.freeList(); if (bucketNum != null) { return bucketNum >= 0 && bucketNum < pagesList.bucketsCount() ? Collections.singleton(new CachePagesListView(pagesList, bucketNum, dataStore.partId())) : Collections.emptyList(); } return IntStream.range(0, pagesList.bucketsCount()) .mapToObj(bucket -> new CachePagesListView(pagesList, bucket, dataStore.partId())) .collect(Collectors.toList()); }, true, cacheDataStore -> partId == null || cacheDataStore.partId() == partId)); }