private void unregister(ConnectPoint connectPoint, HandlerRegistration registration) {
        synchronized (packetHandlers) {
            packetHandlers.remove(connectPoint, registration);

            if (packetHandlers.isEmpty()) {
                cancelPackets();
            }
        }
    }
@Test
    public void testUnregister() {
        // Register a handler and verify the registration is there
        neighbourManager.registerNeighbourHandler(CP1, HANDLER, APP_ID);
        assertTrue(verifyRegistration(CP1, HANDLER, APP_ID));

        // Unregister the handler but supply a different connect point
        neighbourManager.unregisterNeighbourHandler(CP2, HANDLER, APP_ID);

        // Verify the original registration is still there on the original
        // connect point
        assertTrue(verifyRegistration(CP1, HANDLER, APP_ID));

        assertTrue(verifyNoRegistration(CP2));

        // Unregister the handler from the original connect point
        neighbourManager.unregisterNeighbourHandler(CP1, HANDLER, APP_ID);

        // Verify that it is gone
        assertTrue(verifyNoRegistration(CP1));
    }