@Test
void whenOnlyListeningForExtendedStates_thenAddOnlyReceivesNewExtendedStates() {

    (new FilteringStateChangeListenable<>(cache, this::asExtended)).registerStateAddedListener(s -> {
        result = true;
        resultUpdated = s;
    });
    cache.add(state1);
    assertFalse(result);
    cache.add(extended1);
    assertTrue(result);
    assertEquals(extended1, resultUpdated);
    resetResult();;
    // Check that add doesn't fire on updates
    cache.update(state1, state1Updated);
    assertFalse(result);
    cache.update(extended1, extended1Updated);
    assertFalse(result);
    // Check that add doesn't fire on removals
    cache.delete(state1Updated.getId());
    assertFalse(result);
    cache.delete(extended1Updated.getId());
    assertFalse(result);
}