### Question:
EnsResolver { public String resolve(String contractId) { if (isValidEnsName(contractId)) { PublicResolver resolver = obtainPublicResolver(contractId); byte[] nameHash = NameHash.nameHashAsBytes(contractId); String contractAddress = null; try { contractAddress = resolver.addr(nameHash).send(); } catch (Exception e) { throw new RuntimeException("Unable to execute Moac request", e); } if (!WalletUtils.isValidAddress(contractAddress)) { throw new RuntimeException("Unable to resolve address for name: " + contractId); } else { return contractAddress; } } else { return contractId; } } EnsResolver(Chain3j chain3j, long syncThreshold);  EnsResolver(Chain3j chain3j); void setSyncThreshold(long syncThreshold); long getSyncThreshold(); PublicResolver obtainPublicResolver(String ensName); String resolve(String contractId); String reverseResolve(String address); static boolean isValidEnsName(String input);  }### Answer:
@Test public void testResolve() throws Exception { configureSyncing(false); configureLatestBlock(System.currentTimeMillis() / 1000); NetVersion netVersion = new NetVersion(); netVersion.setResult(Byte.toString(ChainId.MAINNET)); String resolverAddress = "0x0000000000000000000000004c641fb9bad9b60ef180c31f56051ce826d21a9a"; String contractAddress = "0x00000000000000000000000019e03255f667bdfd50a32722df860b1eeaf4d635"; McCall resolverAddressResponse = new McCall(); resolverAddressResponse.setResult(resolverAddress); McCall contractAddressResponse = new McCall(); contractAddressResponse.setResult(contractAddress); when(chain3jService.send(any(Request.class), eq(NetVersion.class))) .thenReturn(netVersion); when(chain3jService.send(any(Request.class), eq(McCall.class))) .thenReturn(resolverAddressResponse); when(chain3jService.send(any(Request.class), eq(McCall.class))) .thenReturn(contractAddressResponse); assertThat(ensResolver.resolve("chain3j.eth"), is("0x19e03255f667bdfd50a32722df860b1eeaf4d635")); }