@Override
    public SystemInfoResult getSystemInfo(final Map<String, String> params) {
        final Integer limit = NullSafe.getOrElse(
                params.get(PARAM_NAME_LIMIT),
                Integer::valueOf,
                Integer.MAX_VALUE);

        final String cacheName = params.get(PARAM_NAME_CACHE_NAME);

        if (cacheName != null) {
            final StroomCache<?, ?> cache = caches.get(cacheName);

            if (cache != null) {
                final Set<?> keySet = cache.keySet();

                Stream<?> stream = keySet
                        .stream()
                        .limit(limit);

                final List<?> keyList;
                if (!keySet.isEmpty()) {
                    final Object aKey = keySet.iterator().next();

                    if (aKey instanceof Comparable) {
                        stream = stream
                                .sorted();
                    }
                    keyList = stream
                            .map(key -> {
                                try {
                                    // Try and serialise it
                                    JsonUtil.writeValueAsString(key);
                                } catch (Exception e) {
                                    return "Unable to serialise Key as JSON, dumping as string: "
                                           + key.toString().substring(0, 1_000);
                                }
                                return key;
                            })
                            .collect(Collectors.toList());

                } else {
                    keyList = Collections.emptyList();
                }

                return SystemInfoResult.builder(this)
                        .description("List of cache keys")
                        .addDetail("cacheName", cacheName)
                        .addDetail("keys", keyList)
                        .addDetail("keyCount", keySet.size())
                        .build();
            } else {
                throw new RuntimeException(LogUtil.message("Unknown cache name {}", cacheName));
            }
        } else {
            final List<String> cacheNames = caches.keySet()
                    .stream()
                    .sorted()
                    .limit(limit)
                    .collect(Collectors.toList());


            return SystemInfoResult.builder(this)
                    .description("List of cache names")
                    .addDetail("cacheNames", cacheNames)
                    .addDetail("cacheCount", caches.size())
                    .build();
        }
    }
This is only for tests to save providing a {@link Metrics} instance
stroom-cache/stroom-cache-impl/src/main/java/stroom/cache/impl/CacheManagerImpl.java