@Test
public void multiSuicideTest() throws IOException, InterruptedException {

    String contract =
            "pragma solidity ^0.4.3;" +
            "contract PsychoKiller {" +
            "    function () payable {}" +
            "    function homicide() {" +
            "        suicide(msg.sender);" +
            "    }" +
            "    function multipleHomocide() {" +
            "        PsychoKiller k  = this;" +
            "        k.homicide.gas(10000)();" +
            "        k.homicide.gas(10000)();" +
            "        k.homicide.gas(10000)();" +
            "        k.homicide.gas(10000)();" +
            "    }" +
            "}";
    SolidityCompiler.Result res = SolidityCompiler.compile(
            contract.getBytes(), true, SolidityCompiler.Options.ABI, SolidityCompiler.Options.BIN);
    logger.info(res.errors);
    CompilationResult cres = CompilationResult.parse(res.output);
    BlockchainImpl blockchain = ImportLightTest.createBlockchain(GenesisLoader.loadGenesis(
            getClass().getResourceAsStream("/genesis/genesis-light.json")));
    ECKey sender = ECKey.fromPrivate(Hex.decode("3ec771c31cac8c0dba77a69e503765701d3c2bb62435888d4ffa38fed60c445c")).compress();
    logger.info("address: " + Hex.toHexString(sender.getAddress()));
    if (cres.getContract("PsychoKiller") != null) {
        Transaction tx = createTx(blockchain, sender, new byte[0],
                Hex.decode(cres.getContract("PsychoKiller").bin));
        executeTransaction(blockchain, tx);
        byte[] contractAddress = tx.getContractAddress();
        CallTransaction.Contract contract1 = new CallTransaction.Contract(cres.getContract("PsychoKiller").abi);
        byte[] callData = contract1.getByName("multipleHomocide").encode();
        Transaction tx1 = createTx(blockchain, sender, contractAddress, callData, 0l);
        ProgramResult programResult = executeTransaction(blockchain, tx1).getResult();
        // suicide of a single account should be counted only once
        Assert.assertEquals(24000, programResult.getFutureRefund());
    } else {
        Assert.fail();
    }
}