@Test
  public void twoZonesWithRedundancyAndTwoCopiesOfBucketInSameZoneAndEnforceUniqueZones()
      throws UnknownHostException {

    InternalDistributedMember member1 =
        new InternalDistributedMember(InetAddress.getByName("127.0.0.1"), 1);
    InternalDistributedMember member2 =
        new InternalDistributedMember(InetAddress.getByName("127.0.0.1"), 2);
    InternalDistributedMember member3 =
        new InternalDistributedMember(InetAddress.getByName("127.0.0.1"), 3);
    InternalDistributedMember member4 =
        new InternalDistributedMember(InetAddress.getByName("127.0.0.1"), 4);

    // Create some imbalanced nodes
    PartitionMemberInfoImpl details1 =
        buildDetails(member1, new long[] {1, 0, 1}, new long[] {1, 0, 0});
    PartitionMemberInfoImpl details2 =
        buildDetails(member2, new long[] {1, 1, 0}, new long[] {0, 1, 0});
    PartitionMemberInfoImpl details3 =
        buildDetails(member3, new long[] {0, 0, 1}, new long[] {0, 0, 1});
    PartitionMemberInfoImpl details4 =
        buildDetails(member4, new long[] {0, 1, 0}, new long[] {0, 0, 0});

    when(clusterDistributionManager.getRedundancyZone(member1)).thenReturn("zoneA");
    when(clusterDistributionManager.getRedundancyZone(member2)).thenReturn("zoneA");
    when(clusterDistributionManager.getRedundancyZone(member3)).thenReturn("zoneB");
    when(clusterDistributionManager.getRedundancyZone(member4)).thenReturn("zoneB");

    when(clusterDistributionManager.enforceUniqueZone()).thenReturn(true);

    PartitionedRegionLoadModel model = new PartitionedRegionLoadModel(bucketOperator, 1, 3,
        new ZoneComparer(), Collections.emptySet(), partitionedRegion);
    model.addRegion("a", Arrays.asList(details1, details2, details3, details4),
        new FakeOfflineDetails(),
        true);

    assertThat(doMoves(new CompositeDirector(true, true, true, true), model)).isEqualTo(2);

    assertThat(bucketOperator.primaryMoves).isEqualTo(Collections.emptyList());
    assertThat(bucketOperator.bucketMoves).isEqualTo(Collections.emptyList());

    List<Remove> expectedRemoves = new ArrayList<>();
    expectedRemoves.add(new Remove(member2, 0));

    assertThat(bucketOperator.removes).isEqualTo(expectedRemoves);

    List<Create> expectedCreates = new ArrayList<>();
    expectedCreates.add(new Create(member3, 0));

    assertThat(bucketOperator.creates).isEqualTo(expectedCreates);
  }
Test that when you have an overredundancy in zone a that the member's hosting
bucket is slimmed down to 1 and then zone b gets a copy of the bucket. This internally
is managed by marking a bucket as overredundant and underredundant that the same time.
Overredundant because it over represented in the zone. That extra copy will get deleted
in the zone first, then it will be underredundant. That is why it needs to be marked as low
redundancy too, because then a new copy will need to be added to zone b.
geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/rebalance/PartitionedRegionLoadModelJUnitTest.java