GuavaCacheBasedDoubleSupplierMemoizer extends AbstractGuavaCacheBasedMemoizer<KEY, Double> implements DoubleSupplier { @Override public double getAsDouble() { return get(keySupplier.get(), givenKey -> Double.valueOf(supplier.getAsDouble())).doubleValue(); } GuavaCacheBasedDoubleSupplierMemoizer(
            final Cache<KEY, Double> cache,
            final Supplier<KEY> keySupplier,
            final DoubleSupplier supplier); @Override double getAsDouble();  }
@Test public void shouldReturnSuppliedValue() { final DoubleSupplier supplier = () -> 123.456D; final Supplier<String> keySupplier = () -> "key"; final Cache<String, Double> cache = CacheBuilder.newBuilder().build(); final GuavaCacheBasedDoubleSupplierMemoizer<String> memoizer = new GuavaCacheBasedDoubleSupplierMemoizer<>( cache, keySupplier, supplier); Assert.assertEquals(123.456D, memoizer.getAsDouble(), 0.0D); }