### Question:
DebugStandardTraceBlockToFile implements JsonRpcMethod { @Override public JsonRpcResponse response(final JsonRpcRequestContext requestContext) { final Hash blockHash = requestContext.getRequiredParameter(0, Hash.class); final Optional<TransactionTraceParams> transactionTraceParams = requestContext.getOptionalParameter(1, TransactionTraceParams.class); return blockchainQueries .get() .getBlockchain() .getBlockByHash(blockHash) .map( block -> (JsonRpcResponse) new JsonRpcSuccessResponse( requestContext.getRequest().getId(), traceBlock(block, transactionTraceParams))) .orElse( new JsonRpcErrorResponse( requestContext.getRequest().getId(), JsonRpcError.BLOCK_NOT_FOUND)); } DebugStandardTraceBlockToFile(
      final Supplier<TransactionTracer> transactionTracerSupplier,
      final BlockchainQueries blockchainQueries,
      final Path dataDir); @Override String getName(); @Override JsonRpcResponse response(final JsonRpcRequestContext requestContext);  }### Answer:
@SuppressWarnings("rawtypes") @Test public void shouldTraceTheTransactionUsingTheTransactionTracer() { final BlockDataGenerator blockGenerator = new BlockDataGenerator(); final Block genesis = blockGenerator.genesisBlock(); final Block block = blockGenerator.block( new BlockDataGenerator.BlockOptions().setParentHash(genesis.getHeader().getHash())); final Object[] params = new Object[] {block.getHash(), new HashMap<>()}; final JsonRpcRequestContext request = new JsonRpcRequestContext( new JsonRpcRequest("2.0", "debug_standardTraceBlockToFile", params)); final List<String> paths = new ArrayList<>(); paths.add("path-1"); when(blockchainQueries.getBlockchain()).thenReturn(blockchain); when(blockchain.getBlockByHash(block.getHash())).thenReturn(Optional.of(block)); when(transactionTracer.traceTransactionToFile(eq(block.getHash()), any(), any(), any())) .thenReturn(paths); final JsonRpcSuccessResponse response = (JsonRpcSuccessResponse) debugStandardTraceBlockToFile.response(request); final List result = (ArrayList) response.getResult(); assertThat(result.size()).isEqualTo(1); }