### Question:
BlockRepositoryOkHttpImpl extends AbstractRepositoryOkHttpImpl implements BlockRepository { @Override public Observable<BlockInfo> getBlockByHeight(BigInteger height) { Callable<BlockInfoDTO> callback = () -> getClient().getBlockByHeight(height); return exceptionHandling(call(callback).map(BlockRepositoryOkHttpImpl::toBlockInfo)); } BlockRepositoryOkHttpImpl(ApiClient apiClient); static BlockInfo toBlockInfo(BlockInfoDTO blockInfoDTO); @Override Observable<BlockInfo> getBlockByHeight(BigInteger height); @Override Observable<Page<BlockInfo>> search(BlockSearchCriteria criteria); @Override Observable<MerkleProofInfo> getMerkleTransaction(BigInteger height, String hash); Observable<MerkleProofInfo> getMerkleReceipts(BigInteger height, String hash); BlockRoutesApi getClient();  }### Answer:
@Test public void shouldGetBlockByHeight() throws Exception { Address address = Address.generateRandom(networkType); BlockInfoDTO dto = new BlockInfoDTO(); BlockMetaDTO metaDTO = new BlockMetaDTO(); metaDTO.setHash("someHash"); metaDTO.setTransactionsCount(10); metaDTO.setGenerationHash("generationHash"); metaDTO.setStatementsCount(20); metaDTO.setStateHashSubCacheMerkleRoots(Arrays.asList("string1", "string2")); metaDTO.setTotalFee(BigInteger.valueOf(8L)); dto.setMeta(metaDTO); BlockDTO blockDto = new BlockDTO(); blockDto.setType(16716); blockDto.setSize(10L); blockDto.setVersion(3); blockDto.setSignerPublicKey("B630EFDDFADCC4A2077AB8F1EC846B08FEE2D2972EACF95BBAC6BFAC3D31834C"); blockDto.setBeneficiaryAddress(address.encoded()); blockDto.setHeight(BigInteger.valueOf(9L)); blockDto.setNetwork(NetworkTypeEnum.NUMBER_144); dto.setBlock(blockDto); mockRemoteCall(dto); BigInteger height = BigInteger.valueOf(10L); BlockInfo info = repository.getBlockByHeight(height).toFuture().get(); Assertions.assertNotNull(info); Assertions.assertEquals( blockDto.getBeneficiaryAddress(), info.getBeneficiaryAddress().encoded()); Assertions.assertEquals( blockDto.getSignerPublicKey(), info.getSignerPublicAccount().getPublicKey().toHex()); Assertions.assertEquals(16716, info.getType()); Assertions.assertEquals(10, info.getSize()); Assertions.assertEquals(3, info.getVersion().intValue()); Assertions.assertEquals(NetworkType.MIJIN_TEST, info.getNetworkType()); Assertions.assertEquals(BigInteger.valueOf(9L), info.getHeight()); Assertions.assertEquals(metaDTO.getHash(), info.getHash()); Assertions.assertEquals(metaDTO.getTransactionsCount(), info.getTransactionsCount()); Assertions.assertEquals(metaDTO.getGenerationHash(), info.getGenerationHash()); Assertions.assertEquals(metaDTO.getStatementsCount(), info.getStatementsCount()); Assertions.assertEquals( metaDTO.getStateHashSubCacheMerkleRoots(), info.getSubCacheMerkleRoots()); Assertions.assertEquals(metaDTO.getTotalFee(), info.getTotalFee()); Assertions.assertEquals(blockDto.getHeight(), info.getHeight()); Assertions.assertEquals(address, info.getBeneficiaryAddress()); Assertions.assertEquals(10L, info.getSize()); }