AccountState implements Serializable { public BigInteger addToBalance(BigInteger value) { logger.traceEntry("params: {}", value); Util.check(value != null, "value!=null"); Util.check(value.compareTo(BigInteger.ZERO) > 0, "value must be positive"); Util.check(balance.add(value).compareTo(BigInteger.ZERO) > 0, "Balance would be negative!!!"); this.balance = balance.add(value); return logger.traceExit(this.balance); } AccountState(AccountAddress address);  AccountState(BigInteger nonce, BigInteger balance, AccountAddress address);  AccountState(AccountState source); BigInteger getNonce(); void setNonce(BigInteger nonce); BigInteger getBalance(); void setBalance(BigInteger balance); BigInteger addToBalance(BigInteger value); AccountAddress getAddress(); @Override String toString();  }
@Test(expected = IllegalArgumentException.class) public void testAccountStateAddToBalanceNullShouldThrowException() { AccountState accountState = new AccountState(AccountAddress.EMPTY_ADDRESS); accountState.addToBalance(null); }