@Override
    public synchronized KeyValueIterator<K, ValueAndTimestamp<V>> all() {
        final TreeMap<K, ValueAndTimestamp<V>> copy = new TreeMap<>(this.map);
        return new DelegatingPeekingKeyValueIterator<>(name, new GenericInMemoryKeyValueIterator<>(copy.entrySet().iterator()));
    }
This class is a generic version of the in-memory key-value store that is useful for testing when you
 need a basic KeyValueStore for arbitrary types and don't have/want to write a serde
streams/src/test/java/org/apache/kafka/test/GenericInMemoryTimestampedKeyValueStore.java