GuavaCacheBasedBooleanSupplierMemoizer extends AbstractGuavaCacheBasedMemoizer<KEY, Boolean> implements BooleanSupplier { @Override public boolean getAsBoolean() { return get(keySupplier.get(), givenKey -> Boolean.valueOf(supplier.getAsBoolean())).booleanValue(); } GuavaCacheBasedBooleanSupplierMemoizer(
            final Cache<KEY, Boolean> cache,
            final Supplier<KEY> keySupplier,
            final BooleanSupplier supplier); @Override boolean getAsBoolean();  }
@Test public void shouldReturnSuppliedValue() { final BooleanSupplier supplier = () -> true; final Supplier<String> keySupplier = () -> "key"; final Cache<String, Boolean> cache = CacheBuilder.newBuilder().build(); final GuavaCacheBasedBooleanSupplierMemoizer<String> memoizer = new GuavaCacheBasedBooleanSupplierMemoizer<>( cache, keySupplier, supplier); Assert.assertTrue(memoizer.getAsBoolean()); }