@Test
public void testUseGenesis() throws IOException {

    BigInteger mordenInitialNonse = BigInteger.valueOf(0x100000);
    SystemProperties props = new SystemProperties() {
        @Override
        public BlockchainNetConfig getBlockchainConfig() {
            return new MordenNetConfig();
        }
    };
    Resource sampleGenesisBlock = new ClassPathResource("/config/genesis-sample.json");
    Genesis genesis = props.useGenesis(sampleGenesisBlock.getInputStream());
    /*
     * Assert that MordenNetConfig is used when generating the
     * premine state.
     */
    Map<ByteArrayWrapper, Genesis.PremineAccount> premine = genesis.getPremine();
    assertEquals(1, premine.size());
    Genesis.PremineAccount account = premine.values().iterator().next();
    AccountState state = account.accountState;
    assertEquals(state.getNonce(), mordenInitialNonse);
    //noinspection SpellCheckingInspection
    assertEquals("#0 (4addb5 <~ 000000) Txs:0, Unc: 0", genesis.getShortDescr());
}