public Position merge(final Position other) {
        if (other == null) {
            return this;
        } else {
            for (final Entry<String, ConcurrentHashMap<Integer, Long>> entry : other.position.entrySet()) {
                final String topic = entry.getKey();
                final Map<Integer, Long> partitionMap =
                    position.computeIfAbsent(topic, k -> new ConcurrentHashMap<>());
                for (final Entry<Integer, Long> partitionOffset : entry.getValue().entrySet()) {
                    final Integer partition = partitionOffset.getKey();
                    final Long offset = partitionOffset.getValue();
                    if (!partitionMap.containsKey(partition)
                        || partitionMap.get(partition) < offset) {
                        partitionMap.put(partition, offset);
                    }
                }
            }
            return this;
        }
    }
Merges the provided Position into the current instance.
<p>
If both Positions contain the same topic -&gt; partition -&gt; offset mapping, the resulting
Position will contain a mapping with the larger of the two offsets.
streams/src/main/java/org/apache/kafka/streams/query/Position.java