static <T, D extends Difference> Adapter<T, D> wrap(T value, BiPredicate<? super T, ? super T> isSameImpl, Function<? super T, Integer> diffHashImpl, BiFunction<? super T, ? super T, ? extends D> diffImpl) {
    return new Adapter<>() {
      @Override
      public T getValue() {
        return value;
      }

      @Override
      public boolean isSame(DiffCapable<?, ?> other) {
        //noinspection unchecked
        return other instanceof Adapter && isSameImpl.test(value, ((Adapter<T, D>)other).getValue());
      }

      @Override
      public int diffHashCode() {
        return diffHashImpl.apply(value);
      }

      @Override
      public D difference(Adapter<T, D> past) {
        return diffImpl.apply(past.getValue(), value);
      }
    };
  }
static <T, D extends Difference> Adapter<T, D> wrap(T value, BiPredicate<? super T, ? super T> isSameImpl, Function<? super T, Integer> diffHashImpl, BiFunction<? super T, ? super T, ? extends D> diffImpl)