@Override
    public WindowStoreIterator<V> fetch(final K key, final Instant timeFrom, final Instant timeTo) {
        if (!open) {
            throw new InvalidStateStoreException("Store is not open");
        }
        final List<KeyValue<Long, V>> results = new ArrayList<>();
        for (long now = timeFrom.toEpochMilli(); now <= timeTo.toEpochMilli(); now++) {
            final Map<K, V> kvMap = data.get(now);
            if (kvMap != null && kvMap.containsKey(key)) {
                results.add(new KeyValue<>(now, kvMap.get(key)));
            }
        }
        return new TheWindowStoreIterator<>(results.iterator());
    }
A very simple window store stub for testing purposes.
streams/src/test/java/org/apache/kafka/streams/state/internals/ReadOnlyWindowStoreStub.java