### Question:
TxStats { @JsonGetter("hash") public Hash getHash() { return hash; } TxStats(Hash hash); @JsonGetter("hash") Hash getHash();  }### Answer:
@Test void toJson() throws JsonProcessingException { TxStats stats = new TxStats(Hash.fromBytes(Bytes32.random())); ObjectMapper mapper = new ObjectMapper(); mapper.registerModule(new EthJsonModule()); assertEquals("{\"hash\":\"" + stats.getHash().toHexString() + "\"}", mapper.writeValueAsString(stats)); }