CacheImpl implements Cache { @Override public long incr(final String key, final int by, final long def) throws TimeoutException, CacheException { return cacheClient.incr(key, by, def); } CacheImpl(final String name, final Collection<String> aliases, final CacheClient cacheClient,
            final SerializationType defaultSerializationType, final JsonTranscoder jsonTranscoder, final JavaTranscoder javaTranscoder,
            final CacheTranscoder customTranscoder, final CacheProperties properties); @Override Collection<SocketAddress> getAvailableServers(); @Override T get(final String cacheKey, final SerializationType serializationType); @Override @SuppressWarnings("unchecked") void set(final String cacheKey, final int expiration, final Object value, final SerializationType serializationType); @Override void setSilently(final String cacheKey, final int expiration, final Object value, final SerializationType serializationType); @Override boolean add(final String cacheKey, final int expiration, final Object value, final SerializationType serializationType); @Override boolean addSilently(final String cacheKey, final int expiration, final Object value, final SerializationType serializationType); @Override Map<String, Object> getBulk(final Collection<String> keys, final SerializationType serializationType); @Override long decr(final String key, final int by); @Override boolean delete(final String key); @Override void delete(final Collection<String> keys); @Override void flush(); @Override long incr(final String key, final int by, final long def); @Override long incr(final String key, final int by, final long def, final int exp); @Override boolean isEnabled(); @Override Long getCounter(final String cacheKey); @Override void setCounter(final String cacheKey, final int expiration, final long value); @Override void shutdown(); @Override Object getNativeClient();  }
@Test public void incr() throws TimeoutException, CacheException { String cacheKey = "key1"; int by = 5; int def = 1; cache.incr(cacheKey, by, def); Mockito.verify(cacheClient).incr(getKey(cacheKey), by, def); }
@Test public void incrExp() throws TimeoutException, CacheException { String cacheKey = "key1"; int by = 5; int def = 1; int exp = 60000; cache.incr(cacheKey, by, def, exp); Mockito.verify(cacheClient).incr(getKey(cacheKey), by, def, exp); }