code: public static <T, C extends Collection<T>> Supplier<? extends C> reuse(final Supplier<? extends C> supplier) {
          return new Supplier<C>() {
              private C c;
  
              @Override
              public C get() {
                  if (c == null) {
                      c = supplier.get();
                  } else if (c.size() > 0) {
                      c.clear();
                  }
  
                  return c;
              }
          };
      }
docs: Only for temporary use in sequential stream/single thread, not for parallel stream/multiple threads.
  The returned Collection will clean up before it's returned every time when {@code get} is called.
  Don't save the returned Collection object or use it to save objects.
  
  @param supplier
  @return
  @see {@code Stream.split/sliding};