@Override
    public void addSubscriber(Subscriber subscriber, Class<? extends Event> subscribeType) {
        // Actually, do a classification based on the slowEvent type.
        Class<? extends SlowEvent> subSlowEventType = (Class<? extends SlowEvent>) subscribeType;
        // For stop waiting subscriber, see {@link DefaultPublisher#openEventHandler}.
        subscribers.add(subscriber);
        
        lock.lock();
        try {
            Set<Subscriber> sets = subMappings.get(subSlowEventType);
            if (sets == null) {
                Set<Subscriber> newSet = new ConcurrentHashSet<>();
                newSet.add(subscriber);
                subMappings.put(subSlowEventType, newSet);
                return;
            }
            sets.add(subscriber);
        } finally {
            lock.unlock();
        }
    }
@Test
    void testIgnoreExpiredEvent() throws InterruptedException {
        MockSlowEvent1 mockSlowEvent1 = new MockSlowEvent1();
        MockSlowEvent2 mockSlowEvent2 = new MockSlowEvent2();
        defaultSharePublisher.addSubscriber(smartSubscriber1, MockSlowEvent1.class);
        defaultSharePublisher.addSubscriber(smartSubscriber2, MockSlowEvent2.class);
        defaultSharePublisher.publish(mockSlowEvent1);
        defaultSharePublisher.publish(mockSlowEvent2);
        TimeUnit.MILLISECONDS.sleep(1100);
        verify(smartSubscriber1).onEvent(mockSlowEvent1);
        verify(smartSubscriber2).onEvent(mockSlowEvent2);
        reset(smartSubscriber1);
        when(smartSubscriber1.ignoreExpireEvent()).thenReturn(true);
        defaultSharePublisher.publish(mockSlowEvent1);
        TimeUnit.MILLISECONDS.sleep(100);
        verify(smartSubscriber1, never()).onEvent(mockSlowEvent1);
    }