private void validateConcurrentMapOps(final VM vm) {
    vm.invoke(() -> {
      Cache cache = getCache();
      Region<String, String> region = cache.getRegion(regionName);

      // putIfAbsent returns null if success
      for (int i = putRange_1Start; i <= putRange_1End; i++) {
        String key = Integer.toString(i);
        String value = Integer.toString(i);

        String result = region.putIfAbsent(key, value);

        assertThat(result).isNull();
      }

      assertThat(region.size()).isEqualTo(putRange_1End);
      assertThat(region.isEmpty()).isFalse();

      // putIfAbsent returns existing value if failure
      for (int i = putRange_1Start; i <= putRange_1End; i++) {
        String key = Integer.toString(i);
        String oldValue = Integer.toString(i);
        String newValue = Integer.toString(i + 1);

        String result = region.putIfAbsent(key, newValue);

        assertThat(result).isEqualTo(oldValue);
        assertThat(region.get(key)).isEqualTo(oldValue);
      }

      assertThat(region.size()).isEqualTo(putRange_1End);
      assertThat(region.isEmpty()).isFalse();

      // replace(key, oldValue, newValue) returns true if success
      for (int i = putRange_1Start; i <= putRange_1End; i++) {
        String key = Integer.toString(i);
        String oldValue = Integer.toString(i);
        String newValue = "replaced" + i;

        boolean result = region.replace(key, oldValue, newValue);

        assertThat(result).isTrue();
        assertThat(region.get(key)).isEqualTo(newValue);
      }

      assertThat(region.size()).isEqualTo(putRange_1End);
      assertThat(region.isEmpty()).isFalse();

      // replace(key, oldValue, newValue) returns false if failure
      for (int i = putRange_1Start; i <= putRange_2End; i++) {
        // wrong expected old value
        String key = Integer.toString(i);
        String actualValue = i <= putRange_1End ? "replaced" + i : null;
        String wrongValue = Integer.toString(i);
        String newValue = "not" + i;

        boolean result = region.replace(key, wrongValue, newValue);

        assertThat(result).isFalse();
        assertThat(region.get(key)).isEqualTo(actualValue);
      }

      assertThat(region.size()).isEqualTo(putRange_1End);
      assertThat(region.isEmpty()).isFalse();

      // replace(key, value) returns old value if success
      for (int i = putRange_1Start; i <= putRange_1End; i++) {
        String key = Integer.toString(i);
        String oldValue = "replaced" + i;
        String newValue = "twice replaced" + i;

        String result = region.replace(key, newValue);

        assertThat(result).isEqualTo(oldValue);
        assertThat(region.get(Integer.toString(i))).isEqualTo(newValue);
      }

      assertThat(region.size()).isEqualTo(putRange_1End);
      assertThat(region.isEmpty()).isFalse();

      // replace(key, value) returns null if failure
      for (int i = putRange_2Start; i <= putRange_2End; i++) {
        String key = Integer.toString(i);
        String newValue = "thrice replaced" + i;

        String result = region.replace(key, newValue);

        assertThat(result).isNull();
        assertThat(region.get(key)).isNull();
      }

      assertThat(region.size()).isEqualTo(putRange_1End);
      assertThat(region.isEmpty()).isFalse();

      // remove(key, value) returns false if failure
      for (int i = putRange_1Start; i <= putRange_2End; i++) {
        String key = Integer.toString(i);
        String actualValue = i <= putRange_1End ? "twice replaced" + i : null;
        String wrongValue = Integer.toString(-i);

        boolean result = region.remove(key, wrongValue);

        assertThat(result).isFalse();
        assertThat(region.get(key)).isEqualTo(actualValue);
      }

      assertThat(region.size()).isEqualTo(putRange_1End);
      assertThat(region.isEmpty()).isFalse();

      // remove(key, value) returns true if success
      for (int i = putRange_1Start; i <= putRange_1End; i++) {
        String key = Integer.toString(i);
        String value = "twice replaced" + i;

        boolean result = region.remove(key, value);

        assertThat(result).isTrue();
        assertThat(region.get(key)).isNull();
      }

      assertThat(region.size()).isEqualTo(0);
      assertThat(region.isEmpty()).isTrue();
    });
  }
This is a PartitionedRegion test for scope = D_ACK. 4 VMs are used to create the PR with and
without(Only Accessor) the DataStore.
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionAPIDUnitTest.java