### Question:
DefaultEventBus implements EventBus { @Override public void register(Class<? extends Event> eventClass, EventSubscriber eventSubscriber) { CopyOnWriteArraySet<EventSubscriber> set = eventSubscriberMap.get(eventClass); if (set == null) { set = new CopyOnWriteArraySet<EventSubscriber>(); CopyOnWriteArraySet<EventSubscriber> old = eventSubscriberMap.putIfAbsent(eventClass, set); if (old != null) { set = old; } } set.add(eventSubscriber); LOGGER.debug("Register subscriber: {} of event: {}.", eventSubscriber, eventClass); } DefaultEventBus(RegistryClientConfig config); @Override void register(Class<? extends Event> eventClass, EventSubscriber eventSubscriber); @Override void unRegister(Class<? extends Event> eventClass, EventSubscriber eventSubscriber); @Override void post(final Event event); @Override boolean isEnable(); @Override boolean isEnable(Class<? extends Event> eventClass);  }### Answer:
@Test public void register() { TestEventSubscriber testEventSubscriber = new TestEventSubscriber(true); try { assertFalse(eventBus.isEnable(TestEvent.class)); eventBus.register(TestEvent.class, testEventSubscriber); assertTrue(eventBus.isEnable(TestEvent.class)); } finally { eventBus.unRegister(TestEvent.class, testEventSubscriber); } assertFalse(eventBus.isEnable(TestEvent.class)); }