}
@Test
public void registerConsumerEvent() throws Exception {
FunctionalPubSub pubsub = new FunctionalPubSub();
Disposable disposable = pubsub.observe(UIAction.Click).to(value -> {
pubsub.consumeUI++;
});
pubsub.publish(event(UIAction.Click));
assert pubsub.consumeUI == 1;
pubsub.publish(event(UIAction.Click));
assert pubsub.consumeUI == 2;
pubsub.publish(event(UIAction.Focus));
assert pubsub.consumeUI == 2;
disposable.dispose();
pubsub.publish(event(UIAction.Click));
assert pubsub.consumeUI == 2;
}