### Question:
BroadcastingBlockListener implements BlockListener { @Override public void onBlock(Block block) { eventBroadcaster.broadcastNewBlock(blockDetailsFactory.createBlockDetails(block)); }  @Override void onBlock(Block block);  }### Answer:
@Test public void testOnBlock() { final Block block = Mockito.mock(Block.class); when(block.getNumber()).thenReturn(BigInteger.TEN); underTest.onBlock(block); ArgumentCaptor<BlockDetails> captor = ArgumentCaptor.forClass(BlockDetails.class); verify(mockBroadcaster).broadcastNewBlock(captor.capture()); assertEquals(BigInteger.TEN, captor.getValue().getNumber()); }