SimpleNonceProvider implements NonceProvider { @Override public long incrementAndGetNonce(final AccountAddress accountAddress) { assertNotNull(accountAddress, "AccountAddress must not null"); try { return this.cache.get(accountAddress).incrementAndGet(); } catch (Exception e) { throw new HerajException(e); } } SimpleNonceProvider();  SimpleNonceProvider(final int capacity); @Override void bindNonce(final AccountState accountState); @Override void bindNonce(final AccountAddress accountAddress, final long nonce); @Override long incrementAndGetNonce(final AccountAddress accountAddress); @Override long getLastUsedNonce(final AccountAddress accountAddress); @Override String toString();  }
@Test public void testIncrementAndGetNonce() { final NonceProvider nonceProvider = new SimpleNonceProvider(); final AccountAddress identity = new AergoKeyGenerator().create().getAddress(); final int tryCount = 10; for (int i = 0; i < tryCount; ++i) { nonceProvider.incrementAndGetNonce(identity); } assertEquals(tryCount + 1, nonceProvider.incrementAndGetNonce(identity)); }