@Test
    public void testDeleteSubscriptionAfterCreateSubscription() throws Exception
    {
        // Setup test fixture.
        final CachingPubsubPersistenceProvider provider = new CachingPubsubPersistenceProvider();
        final Node mockNode = Mockito.mock(Node.class);
        Mockito.lenient().when(mockNode.getUniqueIdentifier()).thenReturn(new Node.UniqueIdentifier("mock-service-1", "mock-node-a"));
        final JID subscriber = new JID("test-user-1", "example.org", null);
        final String subscriptionId = "test-subscription-id-" + StringUtils.randomString(7);
        final NodeSubscription subscription = new NodeSubscription(mockNode, subscriber, subscriber, NodeSubscription.State.subscribed, subscriptionId);

        // Execute system under test.
        provider.createSubscription(mockNode, subscription);
        provider.removeSubscription(subscription);

        // Verify results.
        final List<CachingPubsubPersistenceProvider.NodeOperation> pending = provider.nodesToProcess.computeIfAbsent(mockNode.getUniqueIdentifier(), id -> new ArrayList<>());
        assertEquals(0, pending.size());

        assertEquals(0, provider.itemsPending.size());
        assertEquals(0, provider.itemsToAdd.size());
        assertEquals(0, provider.itemsToDelete.size());
    }
Executes a test that, through {@link CachingPubsubPersistenceProvider#createSubscription(Node, NodeSubscription)}
and {@link CachingPubsubPersistenceProvider#removeSubscription(NodeSubscription)} creates and immediately removes
a subscription.

The caching provider can optimize these two operations, where the 'net effect' of them is to have no operation.

Therefor, this test asserts that after each invocation, no operation is scheduled.
xmppserver/src/test/java/org/jivesoftware/openfire/pubsub/CachingPubsubPersistenceProviderSubscriptionOperationsTest.java