@Test
public void testUnsubscribe() throws Exception {

    // check parameters
    try {
        abstractRegistry.unsubscribe(testUrl, null);
        Assertions.fail();
    } catch (Exception e) {
        Assertions.assertTrue(e instanceof IllegalArgumentException);
    }
    // check parameters
    try {
        abstractRegistry.unsubscribe(null, null);
        Assertions.fail();
    } catch (Exception e) {
        Assertions.assertTrue(e instanceof IllegalArgumentException);
    }
    Assertions.assertNull(abstractRegistry.getSubscribed().get(testUrl));
    // check if unsubscribe successfully
    abstractRegistry.subscribe(testUrl, listener);
    abstractRegistry.unsubscribe(testUrl, listener);
    // Since we have subscribe testUrl, here should return a empty set instead of null
    Assertions.assertNotNull(abstractRegistry.getSubscribed().get(testUrl));
    Assertions.assertFalse(abstractRegistry.getSubscribed().get(testUrl).contains(listener));
}