Blockchain implements Serializable, PersistenceUnitContainer { public void setGenesisBlock(Block genesisBlock) { Util.check(genesisBlock != null, "genesisBlock!=null"); this.genesisBlock = genesisBlock; logger.traceExit(); } Blockchain(BlockchainContext context); void generatePersistenceUnitMap(BlockchainContext context); @SuppressWarnings("unchecked") BlockchainPersistenceUnit<H, B> getUnit(BlockchainUnitType type); Class<B> getClazz(BlockchainUnitType type); BlockchainContext getContext(); P2PConnection getConnection(); Block getCurrentBlock(); void setCurrentBlock(Block currentBlock); Block getGenesisBlock(); void setGenesisBlock(Block genesisBlock); BigInteger getCurrentBlockIndex(); void setCurrentBlockIndex(BigInteger currentBlockIndex); Shard getShard(); void flush(); @Override void stopPersistenceUnit(); TransactionsPool getPool(); BigInteger getNetworkHeight(); synchronized void setNetworkHeight(BigInteger networkBlockHeight); @Override String toString();  }
@Test(expected = IllegalArgumentException.class) public void testSetGenesisBlockWithNullShouldThrowException() throws IOException { blockchain.setGenesisBlock(null); }
@Test public void testSetGenesisBlock() throws IOException { Block block = mock(Block.class); blockchain.setGenesisBlock(block); Assert.assertEquals(block, blockchain.getGenesisBlock()); }