### Question:
BlockHeader implements ProtoObject<Proto.Block.Header> { public BlockHeader(byte[] bytes) { this(toProto(bytes)); } BlockHeader(byte[] bytes);  BlockHeader(Proto.Block.Header protoBlockHeader);  BlockHeader(
            byte[] chain,
            byte[] version,
            byte[] type,
            byte[] prevBlockHash,
            long index,
            long timestamp,
            byte[] merkleRoot,
            byte[] stateRoot,
            long bodyLength);  BlockHeader(
            byte[] chain,
            byte[] version,
            byte[] type,
            byte[] prevBlockHash,
            long index,
            long timestamp,
            byte[] stateRoot,
            BlockBody blockBody);  BlockHeader(JsonObject jsonObject); byte[] getChain(); byte[] getVersion(); byte[] getType(); byte[] getPrevBlockHash(); long getIndex(); long getTimestamp(); byte[] getMerkleRoot(); byte[] getStateRoot(); long getBodyLength(); byte[] getHashForSigning(); byte[] getBinaryForSigning(); @Override byte[] toBinary(); @Override Proto.Block.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; }### Answer:
@Test public void testBlockHeader() { JsonObject jsonParam = new JsonObject(); jsonParam.addProperty("address", "5db10750e8caff27f906b41c71b3471057dd2000"); jsonParam.addProperty("amount", "10000000"); JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("method", "transfer"); jsonObject.add("params", jsonParam); TransactionBody txBody = new TransactionBody(jsonObject); TransactionHeader txHeader = new TransactionHeader(chain, version, type, timestamp, txBody); TransactionSignature txSig = new TransactionSignature(TestConstants.wallet(), txHeader.getHashForSigning()); Transaction tx1 = new TransactionImpl(txHeader, txSig.getSignature(), txBody); Transaction tx2 = new TransactionImpl(tx1.toBinary()); List<Transaction> txs1 = new ArrayList<>(); txs1.add(tx1); txs1.add(tx2); log.debug("txs=" + txs1.toString()); BlockBody blockBody1 = new BlockBody(txs1); BlockHeader blockHeader1 = new BlockHeader( chain, version, type, prevBlockHash, Long.MAX_VALUE, Long.MAX_VALUE, blockBody1.getMerkleRoot(), blockBody1.getStateRoot(), Long.MAX_VALUE); assertEquals(BlockHeader.LENGTH, blockHeader1.getBinaryForSigning().length); BlockHeader blockHeader2 = new BlockHeader( chain, version, type, prevBlockHash, index, timestamp, blockBody1.getMerkleRoot(), blockBody1.getStateRoot(), blockBody1.getLength()); assertEquals(BlockHeader.LENGTH, blockHeader2.getBinaryForSigning().length); BlockHeader blockHeader3 = new BlockHeader(blockHeader1.toBinary()); assertEquals(blockHeader1.toJsonObject(), blockHeader3.toJsonObject()); assertArrayEquals(blockHeader1.getHashForSigning(), blockHeader3.getHashForSigning()); BlockHeader blockHeader4 = new BlockHeader(blockHeader1.toBinary()); assertEquals(blockHeader1.toJsonObject(), blockHeader4.toJsonObject()); assertArrayEquals(blockHeader1.getHashForSigning(), blockHeader4.getHashForSigning()); }