Source:
<code>public void testStateTransferWithRequestorsForNonExistentL1Value() throws Exception { L1Manager l1Manager = c1.getAdvancedCache().getComponentRegistry().getComponent(L1Manager.class); l1Manager.addRequestor(key, c3.getCacheManager().getAddress()); assertNull(c3.get(key)); CheckPoint checkPoint = new CheckPoint(); waitUntilToplogyInstalled(c3, checkPoint); waitUntilBeforeTopologyInstalled(c1, checkPoint); waitUntilBeforeTopologyInstalled(c2, checkPoint); <START> factory.setMembersTouse(new boolean[]{true, false, true, false}); <END> EmbeddedCacheManager cm = addClusterEnabledCacheManager(configuration); Future<Void> join = fork(new Callable<Void>() { @Override public Void call() throws Exception { waitForClusterToForm(cacheName); log.debug("4th has joined"); return null; } }); checkPoint.awaitStrict("post_topology_installed_invoked_" + c3, 10, TimeUnit.SECONDS); checkPoint.awaitStrict("pre_topology_installed_invoked_" + c1, 10, TimeUnit.SECONDS); checkPoint.awaitStrict("pre_topology_installed_invoked_" + c2, 10, TimeUnit.SECONDS); assertNull(c1.put(key, newValue)); checkPoint.triggerForever("post_topology_installed_released_" + c3); checkPoint.triggerForever("pre_topology_installed_released_" + c1); checkPoint.triggerForever("pre_topology_installed_released_" + c2); join.get(10, TimeUnit.SECONDS); assertIsInContainerImmortal(c1, key); assertIsNotInL1(c2, key); assertIsInContainerImmortal(c3, key); assertIsNotInL1(cm.getCache(cacheName), key); }</code><technical_language>I recommend check ownership in end of test ConsistentHashFactory network factory reference lost</technical_language>

Target:
public void testStateTransferWithRequestorsForNonExistentL1Value() throws Exception { L1Manager l1Manager = c1.getAdvancedCache().getComponentRegistry().getComponent(L1Manager.class); l1Manager.addRequestor(key, c3.getCacheManager().getAddress()); assertNull(c3.get(key)); CheckPoint checkPoint = new CheckPoint(); waitUntilToplogyInstalled(c3, checkPoint); waitUntilBeforeTopologyInstalled(c1, checkPoint); waitUntilBeforeTopologyInstalled(c2, checkPoint); factory.setMembersToUse(new boolean[]{true, false, true, false}); EmbeddedCacheManager cm = addClusterEnabledCacheManager(configuration); Future<Void> join = fork(new Callable<Void>() { @Override public Void call() throws Exception { waitForClusterToForm(cacheName); log.debug("4th has joined"); return null; } }); checkPoint.awaitStrict("post_topology_installed_invoked_" + c3, 10, TimeUnit.SECONDS); checkPoint.awaitStrict("pre_topology_installed_invoked_" + c1, 10, TimeUnit.SECONDS); checkPoint.awaitStrict("pre_topology_installed_invoked_" + c2, 10, TimeUnit.SECONDS); assertNull(c1.put(key, newValue)); checkPoint.triggerForever("post_topology_installed_released_" + c3); checkPoint.triggerForever("pre_topology_installed_released_" + c1); checkPoint.triggerForever("pre_topology_installed_released_" + c2); join.get(10, TimeUnit.SECONDS); assertIsInContainerImmortal(c1, key); assertIsNotInL1(c2, key); assertIsInContainerImmortal(c3, key); assertIsNotInL1(cm.getCache(cacheName), key); assertTrue(DistributionTestHelper.isOwner(c1, key)); assertFalse(DistributionTestHelper.isOwner(c2, key)); assertTrue(DistributionTestHelper.isOwner(c3, key)); assertFalse(DistributionTestHelper.isOwner(cm.getCache(cacheName), key)); }