### Question:
IbftGetValidatorsByBlockNumber extends AbstractBlockParameterMethod implements JsonRpcMethod { @Override protected Object resultByBlockNumber( final JsonRpcRequestContext request, final long blockNumber) { final Optional<BlockHeader> blockHeader = getBlockchainQueries().getBlockHeaderByNumber(blockNumber); LOG.trace("Received RPC rpcName={} block={}", getName(), blockNumber); return blockHeader .map( header -> blockInterface.validatorsInBlock(header).stream() .map(validator -> validator.toString()) .collect(Collectors.toList())) .orElse(null); } IbftGetValidatorsByBlockNumber(
      final BlockchainQueries blockchainQueries, final BlockInterface blockInterface); @Override String getName();  }### Answer:
@Test public void shouldReturnListOfValidatorsFromBlock() { when(blockchainQueries.getBlockHeaderByNumber(12)).thenReturn(Optional.of(blockHeader)); final List<Address> addresses = Collections.singletonList(Address.ID); final List<String> expectedOutput = Collections.singletonList(Address.ID.toString()); when(ibftBlockInterface.validatorsInBlock(blockHeader)).thenReturn(addresses); Object result = method.resultByBlockNumber(request, 12); assertThat(result).isEqualTo(expectedOutput); }