private static Map<TopicPartition, Long> positionToTopicPartitionMap(final Position position) {
        final Map<TopicPartition, Long> topicPartitions = new HashMap<>();
        final Set<String> topics = position.getTopics();
        for (final String t : topics) {
            final Map<Integer, Long> partitions = position.getPartitionPositions(t);
            for (final Entry<Integer, Long> e : partitions.entrySet()) {
                final TopicPartition tp = new TopicPartition(t, e.getKey());
                topicPartitions.put(tp, e.getValue());
            }
        }
        return topicPartitions;
    }
a utility interface to facilitate stores' query dispatch logic,
allowing them to generically store query execution logic as the values
in a map.
streams/src/main/java/org/apache/kafka/streams/state/internals/StoreQueryUtils.java