private boolean containsKeyInSomeBucket(PartitionedRegion partitionedRegion, Date key) {
    int numberOfBuckets = partitionedRegion.getTotalNumberOfBuckets();
    for (int bucketId = 0; bucketId < numberOfBuckets; bucketId++) {
      if (partitionedRegion.getBucketKeys(bucketId).contains(key)) {
        return true;
      }
    }
    return false;
  }
Returns true if the key is found in any buckets.
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PRCustomPartitioningDistributedTest.java