### Question:
TransactionHeader implements ProtoObject<Proto.Transaction.Header> { public TransactionHeader(byte[] bytes) { this(toProto(bytes)); } TransactionHeader(byte[] bytes);  TransactionHeader(Proto.Transaction.Header protoTransactionHeader);  TransactionHeader(
            byte[] chain,
            byte[] version,
            byte[] type,
            long timestamp,
            byte[] bodyHash,
            long bodyLength);  TransactionHeader(
            byte[] chain,
            byte[] version,
            byte[] type,
            long timestamp,
            TransactionBody txBody);  TransactionHeader(JsonObject jsonObject); byte[] getChain(); byte[] getVersion(); byte[] getType(); long getTimestamp(); byte[] getBodyHash(); long getBodyLength(); byte[] getHashForSigning(); byte[] getBinaryForSigning(); @Override byte[] toBinary(); @Override Proto.Transaction.Header getInstance(); JsonObject toJsonObject(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static final int VERSION_LENGTH; static final int TYPE_LENGTH; static final int LENGTH; }### Answer:
@Test public void testTransactionHeader() { TransactionHeader txHeader = new TransactionHeader(chain, version, type, Long.MAX_VALUE, bodyHash, Long.MAX_VALUE); assertEquals(TransactionHeader.LENGTH, txHeader.getBinaryForSigning().length); TransactionHeader txHeader1 = new TransactionHeader(chain, version, type, timestamp, bodyHash, bodyLength); log.debug(txHeader1.toString()); log.debug(txHeader1.toJsonObject().toString()); log.debug("chain=" + Hex.toHexString(txHeader1.getChain())); log.debug("version=" + Hex.toHexString(txHeader1.getVersion())); log.debug("type=" + Hex.toHexString(txHeader1.getType())); log.debug("timestamp=" + Hex.toHexString(ByteUtil.longToBytes(txHeader1.getTimestamp()))); log.debug("bodyHash=" + Hex.toHexString(txHeader1.getBodyHash())); log.debug("bodyLength=" + Hex.toHexString(ByteUtil.longToBytes(txHeader1.getBodyLength()))); TransactionHeader txHeader2 = new TransactionHeader(chain, version, type, timestamp, txBody); log.debug(txHeader2.toString()); log.debug(txHeader2.toJsonObject().toString()); log.debug("chain=" + Hex.toHexString(txHeader2.getChain())); log.debug("version=" + Hex.toHexString(txHeader2.getVersion())); log.debug("type=" + Hex.toHexString(txHeader2.getType())); log.debug("timestamp=" + Hex.toHexString(ByteUtil.longToBytes(txHeader2.getTimestamp()))); log.debug("bodyHash=" + Hex.toHexString(txHeader2.getBodyHash())); log.debug("bodyLength=" + Hex.toHexString(ByteUtil.longToBytes(txHeader2.getBodyLength()))); assertEquals(txHeader1.toJsonObject(), txHeader2.toJsonObject()); assertArrayEquals(txHeader1.getHashForSigning(), txHeader2.getHashForSigning()); JsonObject jsonObject3 = txHeader2.toJsonObject(); jsonObject3.addProperty("timestamp", Hex.toHexString(ByteUtil.longToBytes(TimeUtils.time() + 1))); log.debug("jsonObject3=" + jsonObject3.toString()); TransactionHeader txHeader3 = new TransactionHeader(jsonObject3); log.debug("txHeader1=" + txHeader1.toJsonObject()); log.debug("txHeader3=" + txHeader3.toJsonObject()); assertNotEquals(txHeader1.toJsonObject(), txHeader3.toJsonObject()); TransactionHeader txHeader4 = new TransactionHeader(txHeader1.toJsonObject()); log.debug("txHeader4=" + txHeader4.toJsonObject()); assertEquals(txHeader1.toJsonObject(), txHeader4.toJsonObject()); }