### Question:
Web3jService implements BlockchainService { @Override public FilterSubscription registerEventListener(ContractEventFilter eventFilter, ContractEventListener eventListener, BigInteger startBlock, BigInteger endBlock, Optional<Runnable> onCompletion) { log.debug("Registering event filter for event: {}", eventFilter.getId()); final ContractEventSpecification eventSpec = eventFilter.getEventSpecification(); final EthFilter ethFilter = new EthFilter(new DefaultBlockParameterNumber(startBlock), new DefaultBlockParameterNumber(endBlock), eventFilter.getContractAddress()); if (eventFilter.getEventSpecification() != null) { ethFilter.addSingleTopic(Web3jUtil.getSignature(eventSpec)); } final Flowable<Log> flowable = web3j .ethLogFlowable(ethFilter) .doOnComplete(() -> { if (onCompletion.isPresent()) { onCompletion.get().run(); } }); final Disposable sub = flowable.subscribe(theLog -> { asyncTaskService.execute(ExecutorNameFactory.build(EVENT_EXECUTOR_NAME, eventFilter.getNode()), () -> { log.debug("Dispatching log: {}", theLog); if (ethFilter.getTopics() == null || ethFilter.getTopics().isEmpty() || ethFilter.getTopics().get(0).getValue().equals(theLog.getTopics().get(0))) { eventListener.onEvent( eventDetailsFactory.createEventDetails(eventFilter, theLog)); } else { log.warn("Filter topic doesn't match log!"); } }); }); if (sub.isDisposed()) { throw new BlockchainException(String.format( "Failed to subcribe for filter %s. The subscription is disposed.", eventFilter.getId())); } return new FilterSubscription(eventFilter, sub, startBlock); } Web3jService(String nodeName,
                        Web3j web3j,
                        ContractEventDetailsFactory eventDetailsFactory,
                        AsyncTaskService asyncTaskService); @Override List<ContractEventDetails> retrieveEvents(ContractEventFilter eventFilter,
                                                     BigInteger startBlock,
                                                     BigInteger endBlock); @Override FilterSubscription registerEventListener(ContractEventFilter eventFilter,
                                                    ContractEventListener eventListener,
                                                    BigInteger startBlock,
                                                    BigInteger endBlock,
                                                    Optional<Runnable> onCompletion); @Override String getClientVersion(); @Override TransactionReceipt getTransactionReceipt(String txId); @Override BigInteger getCurrentBlockNumber(); Optional<Block> getBlock(String blockHash, boolean fullTransactionObjects); List<ContractEventDetails> getEventsForFilter(ContractEventFilter filter, BigInteger blockNumber); @Override String getRevertReason(String from, String to, BigInteger blockNumber, String input);  }### Answer:
@Test public void testRegisterEventListener() throws IOException { final ContractEventDetails eventDetails = doRegisterEventListenerAndTrigger(); assertNotNull(eventDetails); }