android/guava/src/com/google/common/cache/CacheBuilder.java
@CheckReturnValue
  public <K1 extends K, V1 extends V> CacheBuilder<K1, V1> removalListener(
      RemovalListener<? super K1, ? super V1> listener) {
    checkState(this.removalListener == null);

    // safely limiting the kinds of caches this can produce
    @SuppressWarnings("unchecked")
    CacheBuilder<K1, V1> me = (CacheBuilder<K1, V1>) this;
    me.removalListener = checkNotNull(listener);
    return me;
  }
@CheckReturnValue
  public <K1 extends K, V1 extends V> CacheBuilder<K1, V1> removalListener(
      RemovalListener<? super K1, ? super V1> listener) {
    checkState(this.removalListener == null);

    // safely limiting the kinds of caches this can produce
    @SuppressWarnings("unchecked")
    CacheBuilder<K1, V1> me = (CacheBuilder<K1, V1>) this;
    me.removalListener = checkNotNull(listener);
    return me;
  }
@ CheckReturnValue public < K1 extends K , V1 extends V > CacheBuilder < K1 , V1 > removalListener ( RemovalListener < ? super K1 , ? super V1 > listener ) { checkState ( this . removalListener == null ) ; // safely limiting the kinds of caches this can produce @ SuppressWarnings ( "unchecked" ) CacheBuilder < K1 , V1 > me = ( CacheBuilder < K1 , V1 > ) this ; me . removalListener = checkNotNull ( listener ) ; return me ; }
Specifies a listener instance that caches should notify each time an entry is removed for any
{@linkplain RemovalCause reason}. Each cache created by this builder will invoke this listener
as part of the routine maintenance described in the class documentation above.

<p><b>Warning:</b> after invoking this method, do not continue to use <i>this</i> cache builder
reference; instead use the reference this method <i>returns</i>. At runtime, these point to the
same instance, but only the returned reference has the correct generic type information so as
to ensure type safety. For best results, use the standard method-chaining idiom illustrated in
the class documentation above, configuring a builder and building your cache in a single
statement. Failure to heed this advice can result in a {@link ClassCastException} being thrown
by a cache operation at some <i>undefined</i> point in the future.

<p><b>Warning:</b> any exception thrown by {@code listener} will <i>not</i> be propagated to
the {@code Cache} user, only logged via a {@link Logger}.

@return the cache builder reference that should be used instead of {@code this} for any
remaining configuration and cache building
@return this {@code CacheBuilder} instance (for chaining)
@throws IllegalStateException if a removal listener was already set
Specifies a listener instance that caches should notify each time an entry is removed for any { @linkplain RemovalCause reason } . Each cache created by this builder will invoke this listener as part of the routine maintenance described in the class documentation above .