public static KeyValueIterator<Windowed<GenericKey>, ValueAndTimestamp<GenericRow>> fetchAll(
          final ReadOnlyWindowStore<GenericKey, ValueAndTimestamp<GenericRow>> store,
          final Instant lower,
          final Instant upper
  ) {
    final List<ReadOnlyWindowStore<GenericKey, ValueAndTimestamp<GenericRow>>> stores
            = getStores(store);
    final Function<ReadOnlyWindowStore<GenericKey, ValueAndTimestamp<GenericRow>>,
            KeyValueIterator<Windowed<GenericKey>, ValueAndTimestamp<GenericRow>>> fetchFunc =
                windowStore -> fetchAllUncached(windowStore, lower, upper);
    return findFirstNonEmptyIterator(stores, fetchFunc);
  }
@Test
  public void shouldCallUnderlyingStoreForTableScans() throws IllegalAccessException {
    when(provider.stores(any(), any())).thenReturn(ImmutableList.of(meteredWindowStore));
    SERDES_FIELD.set(meteredWindowStore, serdes);
    when(meteredWindowStore.wrapped()).thenReturn(wrappedWindowStore);
    when(wrappedWindowStore.wrapped()).thenReturn(windowStore);
    when(windowStore.fetchAll(any(), any())).thenReturn(keyValueIterator);
    when(keyValueIterator.hasNext()).thenReturn(false);

    WindowStoreCacheBypass.fetchAll(store, Instant.ofEpochMilli(100), Instant.ofEpochMilli(200));
    verify(windowStore).fetchAll(Instant.ofEpochMilli(100L), Instant.ofEpochMilli(200L));
  }