### Question:
TransactionBody { public TransactionBody(String body) { this.body = JsonUtil.parseJsonObject(body); } TransactionBody(String body);  TransactionBody(JsonObject body); JsonObject getBody(); long getLength(); byte[] getHash(); byte[] toBinary(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testTransactionBody() { JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("test", "00"); log.debug("JsonObject=" + jsonObject.toString()); log.debug("JsonObjectSize=" + jsonObject.size()); log.debug("JsonObjectStringSize=" + jsonObject.toString().length()); TransactionBody txBody1 = new TransactionBody(jsonObject); log.debug("txBody={}", txBody1.getBody()); assertEquals(jsonObject.toString(), txBody1.getBody().toString()); log.debug("txBody length={}", txBody1.getLength()); assertEquals(txBody1.toBinary().length, txBody1.getLength()); log.debug("txBody Binary={}", Hex.toHexString(txBody1.toBinary())); assertArrayEquals(SerializationUtil.serializeString(txBody1.toString()), txBody1.toBinary()); log.debug("txBody count={}", txBody1.getCount()); assertEquals(1, txBody1.getCount()); TransactionBody txBody2 = new TransactionBody(txBody1.getBody()); assertEquals(txBody1, txBody2); assertEquals(txBody1.toString(), txBody2.toString()); TransactionBody txBody3 = new TransactionBody(txBody1.toString()); log.debug("txBody1 String={}", txBody1); log.debug("txBody3 String={}", txBody3); assertEquals(txBody1.toString(), txBody3.toString()); byte[] data = SerializationUtil.serializeString(jsonObject.toString()); TransactionBody txBody4 = new TransactionBody(SerializationUtil.deserializeString(data)); log.debug("txBody1 String={}", txBody1); log.debug("txBody4 String={}", txBody4); assertEquals(txBody1, txBody4); }