@Test
    public void testUpdateFromAnotherNodeForNonUniqueInWrongOrder() throws Exception
    {
        final ConcurrentMap<NodeID, Set<String>> reverseLookupMap = new ConcurrentHashMap<>();
        final ReverseLookupUpdatingCacheEntryListener<String, Set<NodeID>> listener = new ReverseLookupUpdatingCacheEntryListener<>(reverseLookupMap, false);
        final NodeID clusterNodeA = NodeID.getInstance(UUID.randomUUID().toString().getBytes());
        final NodeID clusterNodeB = NodeID.getInstance(UUID.randomUUID().toString().getBytes());

        // Execute system under test.
        listener.entryUpdated("somekey", null, null, clusterNodeB);
        listener.entryAdded("somekey", null, clusterNodeA);

        // Assert result
        assertTrue(reverseLookupMap.containsKey(clusterNodeA) && reverseLookupMap.get(clusterNodeA).contains("somekey"));
        assertTrue(reverseLookupMap.containsKey(clusterNodeB) && reverseLookupMap.get(clusterNodeB).contains("somekey"));
    }
Simulates a scenario where one cluster node adds an entry to an otherwise empty cache, followed by another
cluster node updating that entry, establishing itself as an 'owner' of the entry, with a listener that allows for
entries to be owned by more than one cluster node.

In this scenario, the events that are generated by these actions arrive in the reversed order (which, as this is
an async operation, can occur).
xmppserver/src/test/java/org/jivesoftware/util/cache/ReverseLookupUpdatingCacheEntryListenerTest.java