code: public static <T1, T2, T3, T4, R> Function4<T1, T2, T3, T4, R> memoizeQuadFunction(final Function4<T1, T2, T3, T4, R> fn) {
        Function1<Tuple4<T1, T2, T3, T4>, R> memoise2 = memoizeFunction((final Tuple4<T1, T2, T3, T4> quad) -> fn.apply(quad._1(), quad._2(), quad._3(), quad._4()));
          return (t1, t2, t3, t4) -> memoise2.apply(tuple(t1, t2, t3, t4));
      }
docs: Convert a QuadFunction into one that caches it's result
  
  @param fn QuadFunction to memoise
  @return Memoised TriFunction