TransactionBuilder { public TransactionBuilder throwIfSenderCannotCoverFees( Supplier<? extends Throwable> exceptionSupplier) { if (consumer != null) { throw new IllegalStateException( "Can't handle a supplier for this case, since a consumer " + "will be executed if the sender cannot cover the fees."); } supplier = exceptionSupplier; return this; } protected  TransactionBuilder(Neow3j neow); TransactionBuilder wallet(Wallet wallet); TransactionBuilder version(byte version); TransactionBuilder nonce(Long nonce); TransactionBuilder validUntilBlock(long blockNr); TransactionBuilder firstSigner(ScriptHash sender); TransactionBuilder signers(Signer... signers); TransactionBuilder additionalNetworkFee(Long fee); TransactionBuilder script(byte[] script); TransactionBuilder attributes(TransactionAttribute... attributes); NeoInvokeScript callInvokeScript(); Transaction sign(); Transaction getUnsignedTransaction(); TransactionBuilder doIfSenderCannotCoverFees(
            BiConsumer<BigInteger, BigInteger> consumer); TransactionBuilder throwIfSenderCannotCoverFees(
            Supplier<? extends Throwable> exceptionSupplier);  }
@Test public void throwIfSenderCannotCoverFees() throws Throwable { setUpWireMockForCall("invokescript", "invokescript_transfer_with_fixed_sysfee.json"); setUpWireMockForCall("invokefunction", "invokefunction_balanceOf_1000000.json", "668e0c1f9d7b70a99dd9e06eadd4c784d641afbc", "balanceOf", "721e1376b75fe93889023d47832c160fcc5d4a06"); Wallet w = Wallet.withAccounts(account1); TransactionBuilder b = new NeoToken(neow) .invokeFunction(NEP5_TRANSFER, ContractParameter.hash160(account1.getScriptHash()), ContractParameter.hash160(recipient), ContractParameter.integer(5)) .wallet(w) .validUntilBlock(2000000) .signers(Signer.calledByEntry(account1.getScriptHash())) .throwIfSenderCannotCoverFees( () -> new IllegalStateException("test throwIfSenderCannotCoverFees")); exceptionRule.expect(IllegalStateException.class); exceptionRule.expectMessage("test throwIfSenderCannotCoverFees"); b.buildTransaction(); }