Blockchain implements Serializable, PersistenceUnitContainer { public void setCurrentBlock(Block currentBlock) { Util.check(currentBlock != null, "currentBlock!=null"); this.currentBlock = currentBlock; 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 testSetCurrentBlockWithNullShouldThrowException() throws IOException { blockchain.setCurrentBlock(null); }
@Test public void testSetCurrentBlock() throws IOException { Block block = mock(Block.class); blockchain.setCurrentBlock(block); Assert.assertEquals(block, blockchain.getCurrentBlock()); }