GuavaCacheBasedIntSupplierMemoizer extends AbstractGuavaCacheBasedMemoizer<KEY, Integer> implements IntSupplier { @Override public int getAsInt() { return get(keySupplier.get(), givenKey -> Integer.valueOf(supplier.getAsInt())).intValue(); } GuavaCacheBasedIntSupplierMemoizer(
            final Cache<KEY, Integer> cache,
            final Supplier<KEY> keySupplier,
            final IntSupplier supplier); @Override int getAsInt();  }
@Test public void shouldReturnSuppliedValue() { final IntSupplier supplier = () -> 123; final Supplier<String> keySupplier = () -> "key"; final Cache<String, Integer> cache = CacheBuilder.newBuilder().build(); final GuavaCacheBasedIntSupplierMemoizer<String> memoizer = new GuavaCacheBasedIntSupplierMemoizer<>( cache, keySupplier, supplier); Assert.assertEquals(123, memoizer.getAsInt()); }