@Override
    public void unsubscribePreCommit(String portId, Type eventType,
                                     InstancePortAdminService service, String className) {

        store.computeIfPresent(portId, (k, v) -> {

            if (className == null || className.isEmpty()) {
                return null;
            }

            Objects.requireNonNull(v).computeIfPresent(eventType, (i, j) -> {
                Objects.requireNonNull(j).remove(className);
                return j;
            });

            return v;
        });

        if (subscriberCountByEventType(portId, eventType) == 0) {

            InstancePort instPort = service.instancePort(portId);

            if (instPort != null && instPort.state() == REMOVE_PENDING) {
                service.removeInstancePort(portId);
            }
        }
    }
@Test
    public void testUnsubscribePreCommit() {

        sampleSubscribe();

        InstancePortAdminService service = new TestInstancePortAdminService();

        target.unsubscribePreCommit(PORT_ID_1, OPENSTACK_PORT_PRE_REMOVE, service, CLASS_NAME_1);
        target.unsubscribePreCommit(PORT_ID_2, OPENSTACK_PORT_PRE_REMOVE, service, CLASS_NAME_2);

        assertEquals(0, target.subscriberCountByEventType(PORT_ID_1, OPENSTACK_PORT_PRE_REMOVE));
        assertEquals(1, target.subscriberCountByEventType(PORT_ID_2, OPENSTACK_PORT_PRE_REMOVE));

        assertEquals(0, target.subscriberCount(PORT_ID_1));
        assertEquals(2, target.subscriberCount(PORT_ID_2));
    }