@Test
void whenOnlyListeningForExtendedStates_thenChangeReceivesAllExtendedStateChanges() {

    (new FilteringStateChangeListenable<>(cache, this::asExtended)).registerStateChangeListener((old, updated) -> {
        result = true;
        resultOld = old;
        resultUpdated = updated;
    });
    cache.add(state1);
    assertFalse(result);
    cache.add(extended1);
    assertTrue(result);
    assertNull(resultOld);
    assertEquals(extended1, resultUpdated);
    resetResult();
    cache.update(state1, state1Updated);
    assertFalse(result);
    cache.update(extended1, extended1Updated);
    assertTrue(result);
    assertEquals(extended1, resultOld);
    assertEquals(extended1Updated, resultUpdated);
    resetResult();
    cache.delete(state1Updated.getId());
    assertFalse(result);
    cache.delete(extended1Updated.getId());
    assertEquals(extended1Updated, resultOld);
    assertNull(resultUpdated);
}