class MemoizingSupply<T> implements Supply {

    private final Supplier<T> valueSupplier;
    private boolean cached = false;
    private T memoizedValue;

    public MemoizingSupply(Supplier<T> supplier) {
        this.valueSupplier = Objects.requireNonNull(supplier);
    }

    public T read() {<FILL_FUNCTION_BODY>}

}

        if (!cached) {
            cached = true; // Don't re-compute the supply even if the value was null.
            memoizedValue = valueSupplier.get();
        }
        return memoizedValue;
    
<no_super_class>