### Question:
EthSubscriptionNotificationEmitter { public SubscriptionId subscribe(Channel channel) { SubscriptionId subscriptionId = new SubscriptionId(); subscriptions.put(subscriptionId, channel); return subscriptionId; } EthSubscriptionNotificationEmitter(Ethereum ethereum, JsonRpcSerializer jsonRpcSerializer); SubscriptionId subscribe(Channel channel); boolean unsubscribe(SubscriptionId subscriptionId); void unsubscribe(Channel channel);  }### Answer:
@Test public void subscribeReturnsSubscriptionId() { Channel channel = mock(Channel.class); assertThat(emitter.subscribe(channel), notNullValue()); }
@Test public void ethereumOnBlockEventTriggersMessageToChannel() throws JsonProcessingException { Channel channel = mock(Channel.class); emitter.subscribe(channel); when(serializer.serializeMessage(any())) .thenReturn("serialized"); listener.onBlock(TEST_BLOCK, null); verify(channel, times(1)).writeAndFlush(new TextWebSocketFrame("serialized")); }