private List<Integer> findPrimaryBucketOwners(Set<Integer> bucketIdsToConsider,
      HashMap<InternalDistributedMember, List<Integer>> nodeToBucketMap) {
    final List<Integer> bucketIds = new ArrayList<>();
    int retry = 3;
    for (int i = 0; i < retry && (bucketIds.size() != bucketIdsToConsider.size()); i++) {
      bucketIds.clear();
      nodeToBucketMap.clear();
      for (Integer bucketId : bucketIdsToConsider) {
        InternalDistributedMember primary = getPrimaryBucketOwner(bucketId);
        if (primary != null) {
          bucketIds.add(bucketId);
          if (nodeToBucketMap.get(primary) != null) {
            nodeToBucketMap.get(primary).add(bucketId);
          } else {
            List<Integer> bids = new ArrayList<>();
            bids.add(bucketId);
            nodeToBucketMap.put(primary, bids);
          }
        }
      }
    }
    return bucketIds;
  }
@return Map of {@link InternalDistributedMember} to {@link ArrayList} of Integers
geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionQueryEvaluator.java