RedisClient { public Set<Object> keysInRegion(final String region) { return getCache(region).keySet(); } RedisClient(RedissonClient redisson); @SneakyThrows  RedisClient(@NonNull RedissonClient redisson, int expiryInSeconds); long nextTimestamp(final List<Object> keys); long dbSize(); boolean exists(final String region, final Object key); @SuppressWarnings("unchecked") T get(final String region, final Object key); boolean isExpired(final String region, final Object key); Set<Object> keysInRegion(final String region); long keySizeInRegion(final String region); Map<Object, Object> getAll(final String region); void set(final String region, final Object key, Object value); void set(final String region, final Object key, Object value, final long timeoutInSeconds); void set(final String region, final Object key, Object value, final long timeout, final TimeUnit unit); void expire(final String region); void del(final String region, final Object key); void mdel(final String region, final Collection<?> keys); void deleteRegion(final String region); void flushDb(); boolean isShutdown(); void shutdown();  }
@Test public void keysInRegion() { client.deleteRegion(REGION_NAME); assertThat(client.keysInRegion(REGION_NAME)).isEmpty(); int count = 100; List<String> keys = new ArrayList<String>(); for (int i = 0; i < count; i++) { String key = "multiDelete-Key-" + i; client.set(REGION_NAME, key, i); keys.add(key); } Set<Object> loadedKeys = client.keysInRegion(REGION_NAME); assertThat(loadedKeys).isNotEmpty().hasSize(keys.size()); client.deleteRegion(REGION_NAME); assertThat(client.keysInRegion(REGION_NAME)).isEmpty(); assertThat(client.keySizeInRegion(REGION_NAME)).isEqualTo(0); }