@Test
public void testLimitCapacity() {

  final int capacity = 3;
  final SimpleNonceProvider nonceProvider = new SimpleNonceProvider(capacity);
  for (int i = 0; i < 5 * capacity; ++i) {
    final AergoKey key = new AergoKeyGenerator().create();
    nonceProvider.bindNonce(key.getAddress(), 3L);
  }
  assertEquals(capacity, nonceProvider.cache.size());
}