final HazelcastInstance keyOwner = nodeFactory.newHazelcastInstance(config);
final HazelcastInstance instance1 = nodeFactory.newHazelcastInstance(config);
final HazelcastInstance instance2 = nodeFactory.newHazelcastInstance(config);
int k = 0;
final AtomicInteger atomicInteger = new AtomicInteger(0);
<BUG>while (instance1.getPartitionService().getPartition(k++).equals(keyOwner.getCluster().getLocalMember())) ;
final int key = k;</BUG>
final ILock lock1 = instance1.getLock(key);
lock1.lock();
Thread t = new Thread(new Runnable() {

final HazelcastInstance keyOwner = nodeFactory.newHazelcastInstance(config);
final HazelcastInstance instance1 = nodeFactory.newHazelcastInstance(config);
final HazelcastInstance instance2 = nodeFactory.newHazelcastInstance(config);
int k = 0;
final AtomicInteger atomicInteger = new AtomicInteger(0);
while (keyOwner.getCluster().getLocalMember().equals(instance1.getPartitionService().getPartition(k++).getOwner()))
;
final int key = k;
final ILock lock1 = instance1.getLock(key);
lock1.lock();
Thread t = new Thread(new Runnable() {
