code: public static <T, R> Function1<T, R> memoizeFunction(final Function<T, R> fn) {
          final Map<T, R> lazy = new ConcurrentHashMap<>();
          LazyImmutable<R> nullR = LazyImmutable.def();
          return t -> t==null? nullR.computeIfAbsent(()->fn.apply(null)) : lazy.computeIfAbsent(t, fn);
      }
docs: Convert a Function into one that caches it's result
  
  @param fn Function to memoise
  @return Memoised Function