void precheckMaxResultLimitOnLocalPartitions(String mapName) {
        // check if feature is enabled
        if (!isPreCheckEnabled) {
            return;
        }

        // limit number of local partitions to check to keep runtime constant
        PartitionIdSet localPartitions = mapServiceContext.getCachedOwnedPartitions();
        int partitionsToCheck = min(localPartitions.size(), maxLocalPartitionsLimitForPreCheck);
        if (partitionsToCheck == 0) {
            return;
        }

        // calculate size of local partitions
        int localPartitionSize = getLocalPartitionSize(mapName, localPartitions, partitionsToCheck);
        if (localPartitionSize == 0) {
            return;
        }

        // check local result size
        long localResultLimit = getNodeResultLimit(partitionsToCheck);
        if (localPartitionSize > localResultLimit * MAX_RESULT_LIMIT_FACTOR_FOR_PRECHECK) {
            var localMapStatsProvider = mapServiceContext.getLocalMapStatsProvider();
            if (localMapStatsProvider != null && localMapStatsProvider.hasLocalMapStatsImpl(mapName)) {
                localMapStatsProvider.getLocalMapStatsImpl(mapName).incrementQueryResultSizeExceededCount();
            }
            throw new QueryResultSizeExceededException(maxResultLimit, " Result size exceeded in local pre-check.");
        }
    }
@Test
    public void testLocalPreCheckEnabledWitTwoPartitionsBelowLimit() {
        int[] partitionsSizes = {849, 849};
        populatePartitions(partitionsSizes);
        initMocksWithConfiguration(200000, 2);

        limiter.precheckMaxResultLimitOnLocalPartitions(ANY_MAP_NAME);
    }