@Test
public void shouldCorrectlyExecuteLatchWhenCrdCreatedLast() throws Exception {

    IgniteEx crd = startGrid(0);
    IgniteEx ignite1 = startGrid(1);
    startGrid(2);
    //Version which is greater than current.
    AffinityTopologyVersion nextVer = new AffinityTopologyVersion(crd.cluster().topologyVersion() + 1, 0);
    //Send ack message from client latch before server latch would be created.
    ignite1.context().io().sendToGridTopic(
        crd.localNode(),
        GridTopic.TOPIC_EXCHANGE,
        new LatchAckMessage(
            LATCH_NAME, nextVer, false
        ), GridIoPolicy.SYSTEM_POOL
    );
    //Current version increase up to nextVer after this event.
    stopGrid(2);
    //This latch expected ack only from this node and from ignite1 which already sent it.
    Latch latchCrdOther = latchManager(0).getOrCreate(LATCH_NAME, nextVer);
    latchCrdOther.countDown();
    latchCrdOther.await(1, TimeUnit.SECONDS);
}