### Question:
DefaultEventBus implements EventBus { @Override public void post(final Event event) { if (!isEnable()) { return; } CopyOnWriteArraySet<EventSubscriber> subscribers = eventSubscriberMap.get(event.getClass()); if (null != subscribers && !subscribers.isEmpty()) { for (final EventSubscriber subscriber : subscribers) { if (subscriber.isSync()) { handleEvent(subscriber, event); } else { executor.execute(new Runnable() { @Override public void run() { handleEvent(subscriber, event); } }); } } } } 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 post() { TestEventSubscriber testEventSubscriber = new TestEventSubscriber(true); try { assertFalse(eventBus.isEnable(TestEvent.class)); eventBus.register(TestEvent.class, testEventSubscriber); assertTrue(eventBus.isEnable(TestEvent.class)); final String data = "test-data"; eventBus.post(new TestEvent(data)); assertEquals(data, testEventSubscriber.getCache()); } finally { eventBus.unRegister(TestEvent.class, testEventSubscriber); } assertFalse(eventBus.isEnable(TestEvent.class)); }