public static WindowStoreIterator<ValueAndTimestamp<GenericRow>> fetch(
      final ReadOnlyWindowStore<GenericKey, ValueAndTimestamp<GenericRow>> store,
      final GenericKey key,
      final Instant lower,
      final Instant upper
  ) {
    Objects.requireNonNull(key, "key can't be null");
    final List<ReadOnlyWindowStore<GenericKey, ValueAndTimestamp<GenericRow>>> stores
            = getStores(store);
    final Function<ReadOnlyWindowStore<GenericKey, ValueAndTimestamp<GenericRow>>,
            WindowStoreIterator<ValueAndTimestamp<GenericRow>>> fetchFunc = windowStore ->
            fetchUncached(windowStore, key, lower, upper);
    return findFirstNonEmptyIterator(stores, fetchFunc);
  }
@Test
  public void shouldAvoidNonWindowStore() throws IllegalAccessException {
    when(provider.stores(any(), any())).thenReturn(ImmutableList.of(meteredWindowStore));
    SERDES_FIELD.set(meteredWindowStore, serdes);
    when(serdes.rawKey(any())).thenReturn(BYTES);
    when(meteredWindowStore.wrapped()).thenReturn(wrappedWindowStore);
    when(wrappedWindowStore.wrapped()).thenReturn(stateStore);
    when(wrappedWindowStore.fetch(any(), any(), any())).thenReturn(windowStoreIterator);
    when(windowStoreIterator.hasNext()).thenReturn(false);

    WindowStoreCacheBypass.fetch(
        store, SOME_KEY, Instant.ofEpochMilli(100), Instant.ofEpochMilli(200));
    verify(wrappedWindowStore).fetch(
        new Bytes(BYTES), Instant.ofEpochMilli(100L), Instant.ofEpochMilli(200L));
  }