AccountState implements Serializable { public void setNonce(BigInteger nonce) { logger.traceEntry("params: {}", nonce); Util.check(!(nonce == null || nonce.compareTo(BigInteger.ZERO) < 0), "nonce>=0"); Util.check(!(this.nonce != null && this.nonce.compareTo(nonce) > 0), "new nonce should be bigger"); this.nonce = nonce; logger.traceExit(); } 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 testAccountStateSetNonceNegativeShouldThrowException() { AccountState accountState = new AccountState(AccountAddress.EMPTY_ADDRESS); accountState.setNonce(BigInteger.valueOf(-1)); }
@Test(expected = IllegalArgumentException.class) public void testAccountStateSetNonceNullShouldThrowException() { AccountState accountState = new AccountState(AccountAddress.EMPTY_ADDRESS); accountState.setNonce(null); }