@Test
void whenOnlyListeningForExtendedStates_thenIteratorOnlyReturnsThemInOrder() {

    cache.add(state1);
    cache.add(extended1);
    cache.add(state2);
    cache.add(extended2);
    UnmodifiableIterator<ExtendedTestState> iterator = (new FilteringStateChangeListenable<>(cache, this::asExtended)).iterator();
    assertTrue(iterator.hasNext());
    assertEquals(extended1, iterator.next());
    assertTrue(iterator.hasNext());
    assertEquals(extended2, iterator.next());
    assertFalse(iterator.hasNext());
}