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

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

        // Assert result
        assertTrue(reverseLookupMap.containsKey(clusterNode) && reverseLookupMap.get(clusterNode).contains("somekey"));
    }
Simulates a scenario where a cluster node adds an entry to an otherwise empty cache, followed by an update of
that 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