Actually, seeing that you also need the `toFuture` helper function to make this common implementation fit the two user cases I think I'd even prefer inlining the `new EvictionListener[Any, T] { ... }` directly into the respective `builder.listener(...)` calls, e.g.:

    if (onEvict != LruCache.EmptyEvictionHandler)
      builder.listener {
        new EvictionListener[Any, T] {
          ...
        }
      }