@Test
  public void testConflictChecksBasedOnDsidAndTimeStamp() {


    // create two distributed systems with each having a cache containing
    // a Replicated Region with one entry and concurrency checks enabled.

    // Site 1
    Integer lnPort = vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));
    createCacheInVMs(lnPort, vm1);
    Integer lnRecPort = vm1.invoke(WANTestBase::createReceiver);

    // Site 2
    Integer nyPort = vm2.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnPort));
    createCacheInVMs(nyPort, vm3);
    Integer nyRecPort = vm3.invoke(WANTestBase::createReceiver);

    LogWriterUtils.getLogWriter().info("Created locators and receivers in 2 distributed systems");

    // Site 1
    vm1.invoke(() -> WANTestBase.createSender("ln1", 2, false, 10, 1, false, false, null, true));

    vm1.invoke(() -> WANTestBase.createReplicatedRegion("repRegion", "ln1", isOffHeap()));
    vm1.invoke(() -> WANTestBase.startSender("ln1"));
    vm1.invoke(() -> WANTestBase.waitForSenderRunningState("ln1"));

    // Site 2
    vm3.invoke(() -> WANTestBase.createReplicatedRegion("repRegion", "ny1", isOffHeap()));

    vm4.invoke(() -> WANTestBase.createCache(nyPort));
    vm4.invoke(() -> WANTestBase.createSender("ny1", 1, false, 10, 1, false, false, null, true));

    vm4.invoke(() -> WANTestBase.createReplicatedRegion("repRegion", "ny1", isOffHeap()));
    vm4.invoke(() -> WANTestBase.startSender("ny1"));
    vm4.invoke(() -> WANTestBase.waitForSenderRunningState("ny1"));

    Wait.pause(2000);

    // Perform a put in vm1
    vm1.invoke(new CacheSerializableRunnable("Putting an entry in ds1") {

      @Override
      public void run2() throws CacheException {
        assertNotNull(cache);

        Region region = cache.getRegion(SEPARATOR + "repRegion");
        region.put("testKey", "testValue1");

        assertEquals(1, region.size());
      }
    });

    // wait for vm4 to have later timestamp before sending operation to vm1
    Wait.pause(300);

    AsyncInvocation<Void> asynch =
        vm4.invokeAsync(new CacheSerializableRunnable("Putting an entry in ds2 in vm4") {

          @Override
          public void run2() throws CacheException {
            assertNotNull(cache);
            Region region = cache.getRegion(SEPARATOR + "repRegion");

            region.put("testKey", "testValue2");

            assertEquals(1, region.size());
            assertEquals("testValue2", region.get("testKey"));
          }
        });

    try {
      asynch.join(2000);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }

    // Wait for all local ds events be received by vm3.
    Wait.pause(1000);

    vm3.invoke(new CacheSerializableRunnable("Check dsid") {

      @Override
      public void run2() throws CacheException {
        Region region = cache.getRegion("repRegion");

        Region.Entry entry = ((LocalRegion) region).getEntry("testKey", /* null, */
            true); // commented while merging revision 43582
        RegionEntry re = null;
        if (entry instanceof EntrySnapshot) {
          re = ((EntrySnapshot) entry).getRegionEntry();
        } else if (entry instanceof NonTXEntry) {
          re = ((NonTXEntry) entry).getRegionEntry();
        }
        VersionTag tag = re.getVersionStamp().asVersionTag();
        assertEquals(2, tag.getDistributedSystemId());
      }
    });

    // Check vm3 has latest timestamp from vm4.
    long putAllTimeStampVm1 = vm4
        .invoke(NewWANConcurrencyCheckForDestroyDUnitTest::getVersionTimestampAfterPutAllOp);

    long putAllTimeStampVm3 = vm3
        .invoke(NewWANConcurrencyCheckForDestroyDUnitTest::getVersionTimestampAfterPutAllOp);

    assertEquals(putAllTimeStampVm1, putAllTimeStampVm3);
  }
Tests if conflict checks are happening based on DSID and timestamp even if version tag is
generated in local distributed system.
geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/NewWANConcurrencyCheckForDestroyDUnitTest.java