### Question:
ContractService extends AbstractService implements DeployComponent, ExecuteComponent, QueryComponent { public QueryResult tryQuery(final String encodedContractTxHash, final String functionName, final String... args) { logger.trace("Encoded tx hash: {}", encodedContractTxHash); final Pair<ContractTxHash, ContractFunction> pair = find(encodedContractTxHash, functionName); return query(pair.v1, pair.v2, args); }  @Override Logger logger(); DeploymentResult deploy(final BuildDetails buildDetails); ExecutionResult tryExecute(final String encodedContractTxHash, final String functionName,
      final String... args); QueryResult tryQuery(final String encodedContractTxHash, final String functionName,
      final String... args); DeploymentResult getLatestContractInformation(); ContractInterface getInterface(final ContractTxHash contractTxHash);  }### Answer:
@Test public void testTryQuery() { when(contractOperation.deploy(any(Account.class), any(), anyLong(), any())) .thenReturn(contractTxHash); final ContractResult contractResult = mock(ContractResult.class); when(contractResult.getResultInRawBytes()) .thenReturn(BytesValue.of(randomUUID().toString().getBytes())); when(contractOperation.query(any())).thenReturn(contractResult); final BuildDetails buildDetails = new BuildDetails(); buildDetails.setResult(randomUUID().toString()); final DeploymentResult result = contractService.deploy(buildDetails); result.setContractInterface(contractInterface); final QueryResult queryResult = contractService.tryQuery(contractTxHash.toString(), contractFunction.getName()); assertNotNull(queryResult.getResult()); }