void removeSubscription(final Subscription subscription)
    {
        clientLock.lock();
        try
        {
            if (isTerminating || isClosed)
            {
                return;
            }

            if (!subscription.isClosed())
            {
                ensureNotReentrant();

                subscription.internalClose(EXPLICIT_CLOSE_LINGER_NS);
                final long registrationId = subscription.registrationId();
                if (subscription == resourceByRegIdMap.remove(registrationId))
                {
                    asyncCommandIdSet.add(driverProxy.removeSubscription(registrationId));
                }
            }
        }
        finally
        {
            clientLock.unlock();
        }
    }
@Test
    void removeSubscriptionByRegistrationIdIsANoOpIfIdIsUnknown()
    {
        final long subscriptionId = 666;

        conductor.removeSubscription(subscriptionId);

        assertFalse(conductor.asyncCommandIdSet.contains(subscriptionId));
        verify(driverProxy, never()).removeSubscription(subscriptionId);
    }