@Override
  public <T extends State> T state(StateNamespace namespace, StateTag<T> address) {
    return workItemState.get(namespace, address, StateContexts.nullContext());
  }
@Test
  public void testOrderedListClearBeforeRead() throws Exception {
    StateTag<OrderedListState<String>> addr =
        StateTags.orderedList("orderedList", StringUtf8Coder.of());
    OrderedListState<String> orderedListState = underTest.state(NAMESPACE, addr);

    final TimestampedValue<String> helloElement =
        TimestampedValue.of("hello", Instant.ofEpochSecond(1));
    orderedListState.clear();
    orderedListState.add(helloElement);
    assertThat(orderedListState.read(), Matchers.containsInAnyOrder(helloElement));
    // Shouldn't need to read from windmill for this.
    Mockito.verifyZeroInteractions(mockReader);

    assertThat(
        orderedListState.readRange(Instant.ofEpochSecond(1), Instant.ofEpochSecond(2)),
        Matchers.containsInAnyOrder(helloElement));
    // Shouldn't need to read from windmill for this.
    Mockito.verifyZeroInteractions(mockReader);

    // Shouldn't need to read from windmill for this.
    assertThat(
        orderedListState.readRange(Instant.ofEpochSecond(100), Instant.ofEpochSecond(200)),
        Matchers.emptyIterable());
    assertThat(
        orderedListState.readRange(Instant.EPOCH, Instant.ofEpochSecond(1)),
        Matchers.emptyIterable());
    Mockito.verifyZeroInteractions(mockReader);
  }