@Test
  @Parameters({"PARTITION,1", "PARTITION,0", "REPLICATE,0"})
  @TestCaseName("{method}(isPR={0}, redundantCopies={1})")
  public void testPRServerRVDuplicatedKeys(RegionShortcut regionShortcut, int redundantCopies) {
    int serverPort1 = server1.invoke(() -> new ServerBuilder()
        .redundantCopies(redundantCopies)
        .regionShortcut(regionShortcut)
        .create());
    int serverPort2 = server2.invoke(() -> new ServerBuilder()
        .redundantCopies(redundantCopies)
        .regionShortcut(regionShortcut)
        .create());

    client1.invoke(() -> new ClientBuilder()
        .serverPorts(serverPort1)
        .create());
    client2.invoke(() -> new ClientBuilder()
        .registerInterest(true)
        .serverPorts(serverPort2)
        .subscriptionEnabled(true)
        .subscriptionRedundancy()
        .create());

    // client1 add listener and putAll
    client1.invoke(() -> {
      Region<String, TickerData> region = getClientCache().getRegion(regionName);
      doPutAll(region, "key-", ONE_HUNDRED);
      assertThat(region.size()).isEqualTo(ONE_HUNDRED);

      for (int i = 0; i < ONE_HUNDRED; i++) {
        TickerData tickerData = region.getEntry("key-" + i).getValue();
        assertThat(tickerData.getPrice()).isEqualTo(i);
      }
    });

    // test case 3: removeAll a list with duplicated keys

    // put 3 keys then removeAll
    client1.invoke(() -> {
      Region<String, TickerData> region = getClientCache().getRegion(regionName);
      region.put("case3-1", new TickerData());
      region.put("case3-2", new TickerData());
      region.put("case3-3", new TickerData());
    });

    // verify cache server 2
    client2.invoke(() -> {
      Region<String, TickerData> region = getClientCache().getRegion(regionName);

      await().untilAsserted(() -> {
        Entry<String, TickerData> regionEntry = region.getEntry("case3-1");
        assertThat(regionEntry).isNotNull();

        regionEntry = region.getEntry("case3-2");
        assertThat(regionEntry).isNotNull();

        regionEntry = region.getEntry("case3-3");
        assertThat(regionEntry).isNotNull();
      });
    });

    // put 3 keys then removeAll
    client1.invoke(() -> {
      Region<String, TickerData> region = getClientCache().getRegion(regionName);

      Collection<String> keys = new ArrayList<>();
      keys.add("case3-1");
      keys.add("case3-2");
      keys.add("case3-3");
      keys.add("case3-1");
      region.removeAll(keys);

      Entry<String, TickerData> regionEntry = region.getEntry("case3-1");
      assertThat(regionEntry).isNull();

      regionEntry = region.getEntry("case3-2");
      assertThat(regionEntry).isNull();

      regionEntry = region.getEntry("case3-3");
      assertThat(regionEntry).isNull();
    });

    // verify cache server 1
    server1.invoke(() -> {
      Region<String, TickerData> region = getCache().getRegion(regionName);

      Entry<String, TickerData> regionEntry = region.getEntry("case3-1");
      assertThat(regionEntry).isNull();

      regionEntry = region.getEntry("case3-2");
      assertThat(regionEntry).isNull();

      regionEntry = region.getEntry("case3-3");
      assertThat(regionEntry).isNull();
    });

    // verify cache server 2
    server2.invoke(() -> {
      Region<String, TickerData> region = getCache().getRegion(regionName);

      Entry<String, TickerData> regionEntry = region.getEntry("case3-1");
      assertThat(regionEntry).isNull();

      regionEntry = region.getEntry("case3-2");
      assertThat(regionEntry).isNull();

      regionEntry = region.getEntry("case3-3");
      assertThat(regionEntry).isNull();
    });

    // verify cache server 2
    client2.invoke(() -> {
      Region<String, TickerData> region = getClientCache().getRegion(regionName);

      await().untilAsserted(() -> {
        Entry<String, TickerData> regionEntry = region.getEntry("case3-1");
        assertThat(regionEntry).isNull();

        regionEntry = region.getEntry("case3-2");
        assertThat(regionEntry).isNull();

        regionEntry = region.getEntry("case3-3");
        assertThat(regionEntry).isNull();
      });
    });
  }
Tests putAll and removeAll to 2 servers. Use Case: 1) putAll from a single-threaded client to a
replicated region 2) putAll from a multi-threaded client to a replicated region 3)
geode-cq/src/distributedTest/java/org/apache/geode/internal/cache/PutAllClientServerDistributedTest.java