code: public static <T> Supplier<T> memoize(final Supplier<T> supplier) {
          return new Supplier<T>() {
              private volatile boolean initialized = false;
              private T instance = null;
  
              @Override
              public T get() {
                  if (initialized == false) {
                      synchronized (this) {
                          if (initialized == false) {
                              instance = supplier.get();
                          }
  
                      }
                  }
  
                  return instance;
              }
          };
      }
docs: Returns a {@code Supplier} which returns a single instance created by calling the specified {@code supplier.get()}.
  
  @param supplier
  @return