@Test public void append(){ assertThat(DifferenceList.of(1,2,3).append(DifferenceList.of(4,5,6)).run(),equalTo(LazySeq.of(1,2,3,4,5,6))); }
public DifferenceList<T> append(DifferenceList<T> append) { Function<ImmutableList<T>, Trampoline<ImmutableList<T>>> appending2 = append.appending; return new DifferenceList<T>(l-> appending2.apply(l).flatMap(l2->Trampoline.more(()->appending.apply(l2)))); }
DifferenceList implements Folds<T>,
                                          Transformable<T>,
                                          ImmutableList<T>,
                                          Higher<differenceList,T> { public DifferenceList<T> append(DifferenceList<T> append) { Function<ImmutableList<T>, Trampoline<ImmutableList<T>>> appending2 = append.appending; return new DifferenceList<T>(l-> appending2.apply(l).flatMap(l2->Trampoline.more(()->appending.apply(l2)))); } }
DifferenceList implements Folds<T>,
                                          Transformable<T>,
                                          ImmutableList<T>,
                                          Higher<differenceList,T> { public DifferenceList<T> append(DifferenceList<T> append) { Function<ImmutableList<T>, Trampoline<ImmutableList<T>>> appending2 = append.appending; return new DifferenceList<T>(l-> appending2.apply(l).flatMap(l2->Trampoline.more(()->appending.apply(l2)))); }  }
DifferenceList implements Folds<T>,
                                          Transformable<T>,
                                          ImmutableList<T>,
                                          Higher<differenceList,T> { public DifferenceList<T> append(DifferenceList<T> append) { Function<ImmutableList<T>, Trampoline<ImmutableList<T>>> appending2 = append.appending; return new DifferenceList<T>(l-> appending2.apply(l).flatMap(l2->Trampoline.more(()->appending.apply(l2)))); }  static DifferenceList<T> of(LazySeq<T> list); static DifferenceList<T> fromIterable(Iterable<T> it); static DifferenceList<T> fromStream(Stream<T> stream); static DifferenceList<T> of(T... values); static DifferenceList<T> empty(); static DifferenceList<T> unfold(final U seed, final Function<? super U, Option<Tuple2<T, U>>> unfolder); static DifferenceList<T> generate(Supplier<T> s); static DifferenceList<T> generate(Supplier<T> s,long times); @Deprecated static DifferenceList<T> generate(Generator<T> s); static DifferenceList<T> iterate(final T seed, final UnaryOperator<T> f); static DifferenceList<T> iterate(final T seed, final UnaryOperator<T> f,long times); static DifferenceList<T> iterate(final T seed, Predicate<? super T> pred, final UnaryOperator<T> f); static DifferenceList<Integer> range(final int start, final int end); static DifferenceList<Integer> range(final int start, final int step, final int end); static DifferenceList<Long> rangeLong(final long start, final long step, final long end); static DifferenceList<Long> rangeLong(final long start, final long end); DifferenceList<R> map(Function<? super T, ? extends R> fn); @Override DifferenceList<T> peek(Consumer<? super T> c); DifferenceList<R> flatMap(Function<? super T, ? extends ImmutableList<? extends R>> fn); ImmutableList<T> run(); DifferenceList<T> prepend(DifferenceList<T> prepend); DifferenceList<T> append(DifferenceList<T> append); DifferenceList<T> append(T append); DifferenceList<T> prepend(T prepend); DifferenceList<T> memoize(); @Override DifferenceList<R> unitStream(Stream<R> stream); @Override DifferenceList<R> unitIterable(Iterable<R> it); @Override DifferenceList<T> emptyUnit(); @Override DifferenceList<T> replaceFirst(T currentElement, T newElement); @Override DifferenceList<T> removeFirst(Predicate<? super T> pred); @Override DifferenceList<T> subList(int start, int end); @Override DifferenceList<T> drop(long num); @Override DifferenceList<T> take(long num); @Override DifferenceList<T> appendAll(Iterable<? extends T> value); @Override DifferenceList<T> reverse(); @Override Option<T> get(int pos); @Override T getOrElse(int pos, T alt); @Override T getOrElseGet(int pos, Supplier<? extends T> alt); @Override int size(); @Override boolean isEmpty(); @Override DifferenceList<U> ofType(Class<? extends U> type); @Override DifferenceList<T> filterNot(Predicate<? super T> predicate); @Override DifferenceList<T> notNull(); @Override ReactiveSeq<T> stream(); @Override DifferenceList<T> filter(Predicate<? super T> fn); @Override Iterator<T> iterator(); @Override R fold(BiFunction<? super T, ? super ImmutableList<T>, ? extends R> fn, Supplier<? extends R> alt); @Override DifferenceList<T> onEmpty(T value); @Override DifferenceList<T> onEmptyGet(Supplier<? extends T> supplier); @Override ImmutableList<T> onEmptySwitch(Supplier<? extends ImmutableList<T>> supplier); @Override ImmutableList<T> tailOrElse(ImmutableList<T> tail); @Override DifferenceList<R> forEach4(Function<? super T, ? extends Iterable<R1>> iterable1, BiFunction<? super T, ? super R1, ? extends Iterable<R2>> iterable2, Function3<? super T, ? super R1, ? super R2, ? extends Iterable<R3>> iterable3, Function4<? super T, ? super R1, ? super R2, ? super R3, ? extends R> yieldingFunction); @Override DifferenceList<R> forEach4(Function<? super T, ? extends Iterable<R1>> iterable1, BiFunction<? super T, ? super R1, ? extends Iterable<R2>> iterable2, Function3<? super T, ? super R1, ? super R2, ? extends Iterable<R3>> iterable3, Function4<? super T, ? super R1, ? super R2, ? super R3, Boolean> filterFunction, Function4<? super T, ? super R1, ? super R2, ? super R3, ? extends R> yieldingFunction); @Override DifferenceList<R> forEach3(Function<? super T, ? extends Iterable<R1>> iterable1, BiFunction<? super T, ? super R1, ? extends Iterable<R2>> iterable2, Function3<? super T, ? super R1, ? super R2, ? extends R> yieldingFunction); @Override DifferenceList<R> forEach3(Function<? super T, ? extends Iterable<R1>> iterable1, BiFunction<? super T, ? super R1, ? extends Iterable<R2>> iterable2, Function3<? super T, ? super R1, ? super R2, Boolean> filterFunction, Function3<? super T, ? super R1, ? super R2, ? extends R> yieldingFunction); @Override DifferenceList<R> forEach2(Function<? super T, ? extends Iterable<R1>> iterable1, BiFunction<? super T, ? super R1, ? extends R> yieldingFunction); @Override DifferenceList<R> forEach2(Function<? super T, ? extends Iterable<R1>> iterable1, BiFunction<? super T, ? super R1, Boolean> filterFunction, BiFunction<? super T, ? super R1, ? extends R> yieldingFunction); @Override DifferenceList<T> removeStream(Stream<? extends T> stream); @Override DifferenceList<T> removeAt(long pos); @Override DifferenceList<T> removeAll(T... values); @Override DifferenceList<T> retainAll(Iterable<? extends T> it); @Override DifferenceList<T> retainStream(Stream<? extends T> stream); @Override DifferenceList<T> retainAll(T... values); @Override DifferenceList<ReactiveSeq<T>> permutations(); @Override DifferenceList<ReactiveSeq<T>> combinations(int size); @Override DifferenceList<ReactiveSeq<T>> combinations(); @Override DifferenceList<R> zip(BiFunction<? super T, ? super T2, ? extends R> fn, Publisher<? extends T2> publisher); @Override DifferenceList<R> zipWithStream(Stream<? extends U> other, BiFunction<? super T, ? super U, ? extends R> zipper); @Override DifferenceList<Tuple2<T, U>> zipWithPublisher(Publisher<? extends U> other); @Override DifferenceList<Tuple2<T, U>> zip(Iterable<? extends U> other); @Override DifferenceList<R> zip3(Iterable<? extends S> second, Iterable<? extends U> third, Function3<? super T, ? super S, ? super U, ? extends R> fn3); @Override DifferenceList<R> zip4(Iterable<? extends T2> second, Iterable<? extends T3> third, Iterable<? extends T4> fourth, Function4<? super T, ? super T2, ? super T3, ? super T4, ? extends R> fn); @Override DifferenceList<T> combine(BiPredicate<? super T, ? super T> predicate, BinaryOperator<T> op); @Override DifferenceList<T> combine(Monoid<T> op, BiPredicate<? super T, ? super T> predicate); @Override DifferenceList<T> cycle(long times); @Override DifferenceList<T> cycle(Monoid<T> m, long times); @Override DifferenceList<T> cycleWhile(Predicate<? super T> predicate); @Override DifferenceList<T> cycleUntil(Predicate<? super T> predicate); @Override DifferenceList<R> zip(Iterable<? extends U> other, BiFunction<? super T, ? super U, ? extends R> zipper); @Override DifferenceList<Tuple3<T, S, U>> zip3(Iterable<? extends S> second, Iterable<? extends U> third); @Override DifferenceList<Tuple4<T, T2, T3, T4>> zip4(Iterable<? extends T2> second, Iterable<? extends T3> third, Iterable<? extends T4> fourth); @Override DifferenceList<Tuple2<T, Long>> zipWithIndex(); @Override DifferenceList<Seq<T>> sliding(int windowSize); @Override DifferenceList<Seq<T>> sliding(int windowSize, int increment); @Override DifferenceList<C> grouped(int size, Supplier<C> supplier); @Override DifferenceList<Vector<T>> groupedUntil(Predicate<? super T> predicate); @Override DifferenceList<Vector<T>> groupedUntil(BiPredicate<Vector<? super T>, ? super T> predicate); @Override DifferenceList<Tuple2<T, U>> zipWithStream(Stream<? extends U> other); @Override DifferenceList<Vector<T>> groupedWhile(Predicate<? super T> predicate); @Override DifferenceList<C> groupedWhile(Predicate<? super T> predicate, Supplier<C> factory); @Override DifferenceList<C> groupedUntil(Predicate<? super T> predicate, Supplier<C> factory); @Override DifferenceList<Vector<T>> grouped(int groupSize); @Override DifferenceList<T> distinct(); @Override DifferenceList<T> scanLeft(Monoid<T> monoid); @Override DifferenceList<U> scanLeft(U seed, BiFunction<? super U, ? super T, ? extends U> function); @Override DifferenceList<T> scanRight(Monoid<T> monoid); @Override DifferenceList<U> scanRight(U identity, BiFunction<? super T, ? super U, ? extends U> combiner); @Override DifferenceList<T> sorted(); @Override DifferenceList<T> sorted(Comparator<? super T> c); @Override DifferenceList<T> takeWhile(Predicate<? super T> p); @Override DifferenceList<T> dropWhile(Predicate<? super T> p); @Override DifferenceList<T> takeUntil(Predicate<? super T> p); @Override DifferenceList<T> dropUntil(Predicate<? super T> p); @Override DifferenceList<T> dropRight(int num); @Override DifferenceList<T> takeRight(int num); @Override DifferenceList<T> intersperse(T value); @Override DifferenceList<T> shuffle(); @Override DifferenceList<T> shuffle(Random random); @Override DifferenceList<T> slice(long from, long to); @Override DifferenceList<T> sorted(Function<? super T, ? extends U> function); @Override DifferenceList<R> concatMap(Function<? super T, ? extends Iterable<? extends R>> mapper); @Override DifferenceList<R> mergeMap(Function<? super T, ? extends Publisher<? extends R>> fn); @Override DifferenceList<R> mergeMap(int maxConcurecy, Function<? super T, ? extends Publisher<? extends R>> fn); @Override DifferenceList<T> prependStream(Stream<? extends T> stream); @Override DifferenceList<T> appendAll(T... values); @Override DifferenceList<T> prependAll(T... values); @Override DifferenceList<T> insertAt(int pos, T... values); @Override DifferenceList<T> deleteBetween(int start, int end); @Override DifferenceList<T> insertStreamAt(int pos, Stream<T> stream); @Override DifferenceList<T> plusAll(Iterable<? extends T> list); @Override DifferenceList<T> plus(T value); @Override DifferenceList<T> removeValue(T value); @Override DifferenceList<T> removeAll(Iterable<? extends T> value); @Override DifferenceList<T> prependAll(Iterable<? extends T> value); @Override DifferenceList<T> updateAt(int pos, T value); @Override DifferenceList<T> insertAt(int pos, Iterable<? extends T> values); @Override DifferenceList<T> insertAt(int i, T value); @Override R fold(Function<? super Some<T>, ? extends R> fn1, Function<? super None<T>, ? extends R> fn2); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
DifferenceList implements Folds<T>,
                                          Transformable<T>,
                                          ImmutableList<T>,
                                          Higher<differenceList,T> { public DifferenceList<T> append(DifferenceList<T> append) { Function<ImmutableList<T>, Trampoline<ImmutableList<T>>> appending2 = append.appending; return new DifferenceList<T>(l-> appending2.apply(l).flatMap(l2->Trampoline.more(()->appending.apply(l2)))); }  static DifferenceList<T> of(LazySeq<T> list); static DifferenceList<T> fromIterable(Iterable<T> it); static DifferenceList<T> fromStream(Stream<T> stream); static DifferenceList<T> of(T... values); static DifferenceList<T> empty(); static DifferenceList<T> unfold(final U seed, final Function<? super U, Option<Tuple2<T, U>>> unfolder); static DifferenceList<T> generate(Supplier<T> s); static DifferenceList<T> generate(Supplier<T> s,long times); @Deprecated static DifferenceList<T> generate(Generator<T> s); static DifferenceList<T> iterate(final T seed, final UnaryOperator<T> f); static DifferenceList<T> iterate(final T seed, final UnaryOperator<T> f,long times); static DifferenceList<T> iterate(final T seed, Predicate<? super T> pred, final UnaryOperator<T> f); static DifferenceList<Integer> range(final int start, final int end); static DifferenceList<Integer> range(final int start, final int step, final int end); static DifferenceList<Long> rangeLong(final long start, final long step, final long end); static DifferenceList<Long> rangeLong(final long start, final long end); DifferenceList<R> map(Function<? super T, ? extends R> fn); @Override DifferenceList<T> peek(Consumer<? super T> c); DifferenceList<R> flatMap(Function<? super T, ? extends ImmutableList<? extends R>> fn); ImmutableList<T> run(); DifferenceList<T> prepend(DifferenceList<T> prepend); DifferenceList<T> append(DifferenceList<T> append); DifferenceList<T> append(T append); DifferenceList<T> prepend(T prepend); DifferenceList<T> memoize(); @Override DifferenceList<R> unitStream(Stream<R> stream); @Override DifferenceList<R> unitIterable(Iterable<R> it); @Override DifferenceList<T> emptyUnit(); @Override DifferenceList<T> replaceFirst(T currentElement, T newElement); @Override DifferenceList<T> removeFirst(Predicate<? super T> pred); @Override DifferenceList<T> subList(int start, int end); @Override DifferenceList<T> drop(long num); @Override DifferenceList<T> take(long num); @Override DifferenceList<T> appendAll(Iterable<? extends T> value); @Override DifferenceList<T> reverse(); @Override Option<T> get(int pos); @Override T getOrElse(int pos, T alt); @Override T getOrElseGet(int pos, Supplier<? extends T> alt); @Override int size(); @Override boolean isEmpty(); @Override DifferenceList<U> ofType(Class<? extends U> type); @Override DifferenceList<T> filterNot(Predicate<? super T> predicate); @Override DifferenceList<T> notNull(); @Override ReactiveSeq<T> stream(); @Override DifferenceList<T> filter(Predicate<? super T> fn); @Override Iterator<T> iterator(); @Override R fold(BiFunction<? super T, ? super ImmutableList<T>, ? extends R> fn, Supplier<? extends R> alt); @Override DifferenceList<T> onEmpty(T value); @Override DifferenceList<T> onEmptyGet(Supplier<? extends T> supplier); @Override ImmutableList<T> onEmptySwitch(Supplier<? extends ImmutableList<T>> supplier); @Override ImmutableList<T> tailOrElse(ImmutableList<T> tail); @Override DifferenceList<R> forEach4(Function<? super T, ? extends Iterable<R1>> iterable1, BiFunction<? super T, ? super R1, ? extends Iterable<R2>> iterable2, Function3<? super T, ? super R1, ? super R2, ? extends Iterable<R3>> iterable3, Function4<? super T, ? super R1, ? super R2, ? super R3, ? extends R> yieldingFunction); @Override DifferenceList<R> forEach4(Function<? super T, ? extends Iterable<R1>> iterable1, BiFunction<? super T, ? super R1, ? extends Iterable<R2>> iterable2, Function3<? super T, ? super R1, ? super R2, ? extends Iterable<R3>> iterable3, Function4<? super T, ? super R1, ? super R2, ? super R3, Boolean> filterFunction, Function4<? super T, ? super R1, ? super R2, ? super R3, ? extends R> yieldingFunction); @Override DifferenceList<R> forEach3(Function<? super T, ? extends Iterable<R1>> iterable1, BiFunction<? super T, ? super R1, ? extends Iterable<R2>> iterable2, Function3<? super T, ? super R1, ? super R2, ? extends R> yieldingFunction); @Override DifferenceList<R> forEach3(Function<? super T, ? extends Iterable<R1>> iterable1, BiFunction<? super T, ? super R1, ? extends Iterable<R2>> iterable2, Function3<? super T, ? super R1, ? super R2, Boolean> filterFunction, Function3<? super T, ? super R1, ? super R2, ? extends R> yieldingFunction); @Override DifferenceList<R> forEach2(Function<? super T, ? extends Iterable<R1>> iterable1, BiFunction<? super T, ? super R1, ? extends R> yieldingFunction); @Override DifferenceList<R> forEach2(Function<? super T, ? extends Iterable<R1>> iterable1, BiFunction<? super T, ? super R1, Boolean> filterFunction, BiFunction<? super T, ? super R1, ? extends R> yieldingFunction); @Override DifferenceList<T> removeStream(Stream<? extends T> stream); @Override DifferenceList<T> removeAt(long pos); @Override DifferenceList<T> removeAll(T... values); @Override DifferenceList<T> retainAll(Iterable<? extends T> it); @Override DifferenceList<T> retainStream(Stream<? extends T> stream); @Override DifferenceList<T> retainAll(T... values); @Override DifferenceList<ReactiveSeq<T>> permutations(); @Override DifferenceList<ReactiveSeq<T>> combinations(int size); @Override DifferenceList<ReactiveSeq<T>> combinations(); @Override DifferenceList<R> zip(BiFunction<? super T, ? super T2, ? extends R> fn, Publisher<? extends T2> publisher); @Override DifferenceList<R> zipWithStream(Stream<? extends U> other, BiFunction<? super T, ? super U, ? extends R> zipper); @Override DifferenceList<Tuple2<T, U>> zipWithPublisher(Publisher<? extends U> other); @Override DifferenceList<Tuple2<T, U>> zip(Iterable<? extends U> other); @Override DifferenceList<R> zip3(Iterable<? extends S> second, Iterable<? extends U> third, Function3<? super T, ? super S, ? super U, ? extends R> fn3); @Override DifferenceList<R> zip4(Iterable<? extends T2> second, Iterable<? extends T3> third, Iterable<? extends T4> fourth, Function4<? super T, ? super T2, ? super T3, ? super T4, ? extends R> fn); @Override DifferenceList<T> combine(BiPredicate<? super T, ? super T> predicate, BinaryOperator<T> op); @Override DifferenceList<T> combine(Monoid<T> op, BiPredicate<? super T, ? super T> predicate); @Override DifferenceList<T> cycle(long times); @Override DifferenceList<T> cycle(Monoid<T> m, long times); @Override DifferenceList<T> cycleWhile(Predicate<? super T> predicate); @Override DifferenceList<T> cycleUntil(Predicate<? super T> predicate); @Override DifferenceList<R> zip(Iterable<? extends U> other, BiFunction<? super T, ? super U, ? extends R> zipper); @Override DifferenceList<Tuple3<T, S, U>> zip3(Iterable<? extends S> second, Iterable<? extends U> third); @Override DifferenceList<Tuple4<T, T2, T3, T4>> zip4(Iterable<? extends T2> second, Iterable<? extends T3> third, Iterable<? extends T4> fourth); @Override DifferenceList<Tuple2<T, Long>> zipWithIndex(); @Override DifferenceList<Seq<T>> sliding(int windowSize); @Override DifferenceList<Seq<T>> sliding(int windowSize, int increment); @Override DifferenceList<C> grouped(int size, Supplier<C> supplier); @Override DifferenceList<Vector<T>> groupedUntil(Predicate<? super T> predicate); @Override DifferenceList<Vector<T>> groupedUntil(BiPredicate<Vector<? super T>, ? super T> predicate); @Override DifferenceList<Tuple2<T, U>> zipWithStream(Stream<? extends U> other); @Override DifferenceList<Vector<T>> groupedWhile(Predicate<? super T> predicate); @Override DifferenceList<C> groupedWhile(Predicate<? super T> predicate, Supplier<C> factory); @Override DifferenceList<C> groupedUntil(Predicate<? super T> predicate, Supplier<C> factory); @Override DifferenceList<Vector<T>> grouped(int groupSize); @Override DifferenceList<T> distinct(); @Override DifferenceList<T> scanLeft(Monoid<T> monoid); @Override DifferenceList<U> scanLeft(U seed, BiFunction<? super U, ? super T, ? extends U> function); @Override DifferenceList<T> scanRight(Monoid<T> monoid); @Override DifferenceList<U> scanRight(U identity, BiFunction<? super T, ? super U, ? extends U> combiner); @Override DifferenceList<T> sorted(); @Override DifferenceList<T> sorted(Comparator<? super T> c); @Override DifferenceList<T> takeWhile(Predicate<? super T> p); @Override DifferenceList<T> dropWhile(Predicate<? super T> p); @Override DifferenceList<T> takeUntil(Predicate<? super T> p); @Override DifferenceList<T> dropUntil(Predicate<? super T> p); @Override DifferenceList<T> dropRight(int num); @Override DifferenceList<T> takeRight(int num); @Override DifferenceList<T> intersperse(T value); @Override DifferenceList<T> shuffle(); @Override DifferenceList<T> shuffle(Random random); @Override DifferenceList<T> slice(long from, long to); @Override DifferenceList<T> sorted(Function<? super T, ? extends U> function); @Override DifferenceList<R> concatMap(Function<? super T, ? extends Iterable<? extends R>> mapper); @Override DifferenceList<R> mergeMap(Function<? super T, ? extends Publisher<? extends R>> fn); @Override DifferenceList<R> mergeMap(int maxConcurecy, Function<? super T, ? extends Publisher<? extends R>> fn); @Override DifferenceList<T> prependStream(Stream<? extends T> stream); @Override DifferenceList<T> appendAll(T... values); @Override DifferenceList<T> prependAll(T... values); @Override DifferenceList<T> insertAt(int pos, T... values); @Override DifferenceList<T> deleteBetween(int start, int end); @Override DifferenceList<T> insertStreamAt(int pos, Stream<T> stream); @Override DifferenceList<T> plusAll(Iterable<? extends T> list); @Override DifferenceList<T> plus(T value); @Override DifferenceList<T> removeValue(T value); @Override DifferenceList<T> removeAll(Iterable<? extends T> value); @Override DifferenceList<T> prependAll(Iterable<? extends T> value); @Override DifferenceList<T> updateAt(int pos, T value); @Override DifferenceList<T> insertAt(int pos, Iterable<? extends T> values); @Override DifferenceList<T> insertAt(int i, T value); @Override R fold(Function<? super Some<T>, ? extends R> fn1, Function<? super None<T>, ? extends R> fn2); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }