private static ConcurrentHashMap<String, ConcurrentHashMap<Integer, Long>> deepCopy(
        final Map<String, ? extends Map<Integer, Long>> map) {
        if (map == null) {
            return new ConcurrentHashMap<>();
        } else {
            final ConcurrentHashMap<String, ConcurrentHashMap<Integer, Long>> copy =
                new ConcurrentHashMap<>(map.size());
            for (final Entry<String, ? extends Map<Integer, Long>> entry : map.entrySet()) {
                copy.put(entry.getKey(), new ConcurrentHashMap<>(entry.getValue()));
            }
            return copy;
        }
    }
Return the partition -&gt; offset mapping for a specific topic.
streams/src/main/java/org/apache/kafka/streams/query/Position.java