class LazilyInstantiate<T> implements Supplier<T> {

    private final Supplier<T> supplier;
    private Supplier<T> current;
    private volatile boolean active;

    public static <T> LazilyInstantiate<T> using(Supplier<T> supplier) {
        return new LazilyInstantiate<>(supplier);
    }

    /**
     * Executes the {@link #using(java.util.function.Supplier)} supplier in a
     * thread-safe manner if it has not yet been executed, and keeps the result
     * to provide to every caller of this method.
     * @return the result of {@code supplier}
     */
    @Override
    public T get() {
        return current.get();
    }

    /**
     * Gets a value indicating if the instance is active and no longer
     * technically lazy, since {@link #get()} has been called.
     */
    public boolean isActive() {
        return active;
    }

    private LazilyInstantiate(Supplier<T> supplier) {
        this.supplier = supplier;
        this.current = this::swapper;
    }

    /**
     * Swaps itself out for a supplier of an instantiated object.
     */
    private synchronized T swapper() {<FILL_FUNCTION_BODY>}

    private static class Factory<U> implements Supplier<U> {

        private final U obj;

        Factory(U obj) {
            this.obj = obj;
        }

        @Override
        public U get() {
            return obj;
        }
    }
}

        if (!(current instanceof Factory)) {
            T obj = supplier.get();
            current = new Factory<>(obj);
            active = true;
        }
        return current.get();
    
<no_super_class>