@Test void getIfAvailable_shouldReturnEmptyWhenAbsent() { assertThat(taskQueue.getIfAvailable(1)).isEmpty(); }
public Optional<V> getIfAvailable(final K key) { return Optional.ofNullable(cache.get(key)); }
CachingTaskQueue { public Optional<V> getIfAvailable(final K key) { return Optional.ofNullable(cache.get(key)); } }
CachingTaskQueue { public Optional<V> getIfAvailable(final K key) { return Optional.ofNullable(cache.get(key)); } CachingTaskQueue(
      final AsyncRunner asyncRunner,
      final MetricsSystem metricsSystem,
      final String metricsPrefix,
      final IntSupplier activeTaskLimit,
      final int maxCacheSize); }
CachingTaskQueue { public Optional<V> getIfAvailable(final K key) { return Optional.ofNullable(cache.get(key)); } CachingTaskQueue(
      final AsyncRunner asyncRunner,
      final MetricsSystem metricsSystem,
      final String metricsPrefix,
      final IntSupplier activeTaskLimit,
      final int maxCacheSize); static CachingTaskQueue<K, V> create(
      final AsyncRunner asyncRunner,
      final MetricsSystem metricsSystem,
      final String metricsPrefix,
      final int maxCacheSize); void startMetrics(); synchronized SafeFuture<Optional<V>> perform(final CacheableTask<K, V> task); Optional<V> getIfAvailable(final K key); void cache(final K key, final V value); void cacheAll(final Map<K, V> values); void remove(final K key); }
CachingTaskQueue { public Optional<V> getIfAvailable(final K key) { return Optional.ofNullable(cache.get(key)); } CachingTaskQueue(
      final AsyncRunner asyncRunner,
      final MetricsSystem metricsSystem,
      final String metricsPrefix,
      final IntSupplier activeTaskLimit,
      final int maxCacheSize); static CachingTaskQueue<K, V> create(
      final AsyncRunner asyncRunner,
      final MetricsSystem metricsSystem,
      final String metricsPrefix,
      final int maxCacheSize); void startMetrics(); synchronized SafeFuture<Optional<V>> perform(final CacheableTask<K, V> task); Optional<V> getIfAvailable(final K key); void cache(final K key, final V value); void cacheAll(final Map<K, V> values); void remove(final K key);  }