public List<Integer> getLocalNonPrimaryBucketsListTestOnly() {
    final List<Integer> nonPrimaryBucketList = new ArrayList<>();
    visitBuckets((bucketId, r) -> {
      BucketRegion br = (BucketRegion) r;
      BucketAdvisor ba = (BucketAdvisor) br.getDistributionAdvisor();
      if (!ba.isPrimary()) {
        nonPrimaryBucketList.add(bucketId);
      }
    });
    return nonPrimaryBucketList;
  }
<i>Test Method</i> Return the list of all the non primary bucket ids in this data store.
geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionDataStore.java