class FilteringStateChangeListenable implements StateChangeListenable<C> {

    @Override
    public void registerAtomicStateChangeListener(AtomicStateChangeListener<? super C> listener) {
        backingListenable.registerAtomicStateChangeListener(changes -> {
            ImmutableList<Change<C>> plannableChanges = StreamSupport.stream(changes.spliterator(), false)
                    .map(this::wrapChange)
                    .filter(Objects::nonNull)
                    .collect(ImmutableList.toImmutableList());
            ((AtomicStateChangeListener<C>)listener).stateChanged(plannableChanges);  // cast needed because of "? super"
        });
    }

    public  FilteringStateChangeListenable(StateChangeListenable<T> backingListenable, Function<? super T, C> mapAndFilter);

}