@Override
  @SuppressWarnings("NullAway")
  public void onRemoval(K key, @Nullable Expirable<V> expirable, RemovalCause cause) {
    if (expirable != null) {
      V value = expirable.get();
      if (cause == RemovalCause.EXPIRED) {
        dispatcher.publishExpiredQuietly(cache, key, value);
      } else {
        dispatcher.publishRemovedQuietly(cache, key, value);
      }
      statistics.recordEvictions(1L);
    }
  }
@Test(dataProvider = "notifications")
  public void publishIfEvicted(Integer key, Expirable<Integer> value, RemovalCause cause) {
    listener.onRemoval(key, value, cause);

    if (cause.wasEvicted()) {
      if (cause == RemovalCause.EXPIRED) {
        verify(entryListener).onExpired(any());
      } else {
        verify(entryListener).onRemoved(any());
      }
      assertThat(statistics.getCacheEvictions()).isEqualTo(1L);
    } else {
      verify(entryListener, never()).onRemoved(any());
      assertThat(statistics.getCacheEvictions()).isEqualTo(0L);
    }
  }