@Test public void leftOuterJoin() { Index<Character, String> left = Index.on(Stream.of("carrot", "banana", "apple"), indexOnFirstChar); Index<Character, String> right = Index.on(Stream.of("catamorphism", "banausic", "ballistic", "diagonally"), indexOnFirstChar); assertThat(left.leftOuterJoin(right).collect(Collectors.toList()), hasItems( T2.of("apple", Optional.empty()), T2.of("banana", Optional.of("banausic")), T2.of("banana", Optional.of("ballistic")), T2.of("carrot", Optional.of("catamorphism")))); }
public <R> Stream<T2<L, Optional<R>>> leftOuterJoin(Index<K, R> other) { return matchAndMerge(other, leftOuterJoinMerger()); }
Index { public <R> Stream<T2<L, Optional<R>>> leftOuterJoin(Index<K, R> other) { return matchAndMerge(other, leftOuterJoinMerger()); } }
Index { public <R> Stream<T2<L, Optional<R>>> leftOuterJoin(Index<K, R> other) { return matchAndMerge(other, leftOuterJoinMerger()); } private  Index(Comparator<? super K> comparator, SortedMap<K, Set<L>> indexed); }
Index { public <R> Stream<T2<L, Optional<R>>> leftOuterJoin(Index<K, R> other) { return matchAndMerge(other, leftOuterJoinMerger()); } private  Index(Comparator<? super K> comparator, SortedMap<K, Set<L>> indexed); static Index<K, L> on(Stream<? extends L> stream, Function<? super L, ? extends K> key); static Index<K, L> on(Stream<? extends L> stream, Function<? super L, ? extends K> key, Comparator<? super K> comparator); Spliterator<Map.Entry<K, Set<L>>> entrySpliterator(); Set<K> keys(); Stream<T2<L, Set<R>>> oneToMany(Index<K, R> other); Stream<T2<L, Set<R>>> strictOneToMany(Index<K, R> other); Stream<T2<L, R>> manyToOne(Index<K, R> other); Stream<T2<L, R>> strictManyToOne(Index<K, R> other); Stream<T2<L, R>> strictOneToOne(Index<K, R> other); Stream<T2<L, Optional<R>>> leftOuterJoin(Index<K, R> other); Stream<T2<Optional<L>, R>> rightOuterJoin(Index<K, R> other); Stream<T2<L, R>> innerJoin(Index<K, R> other); Stream<T2<Optional<L>, Optional<R>>> outerJoin(Index<K, R> other); @Override String toString(); }
Index { public <R> Stream<T2<L, Optional<R>>> leftOuterJoin(Index<K, R> other) { return matchAndMerge(other, leftOuterJoinMerger()); } private  Index(Comparator<? super K> comparator, SortedMap<K, Set<L>> indexed); static Index<K, L> on(Stream<? extends L> stream, Function<? super L, ? extends K> key); static Index<K, L> on(Stream<? extends L> stream, Function<? super L, ? extends K> key, Comparator<? super K> comparator); Spliterator<Map.Entry<K, Set<L>>> entrySpliterator(); Set<K> keys(); Stream<T2<L, Set<R>>> oneToMany(Index<K, R> other); Stream<T2<L, Set<R>>> strictOneToMany(Index<K, R> other); Stream<T2<L, R>> manyToOne(Index<K, R> other); Stream<T2<L, R>> strictManyToOne(Index<K, R> other); Stream<T2<L, R>> strictOneToOne(Index<K, R> other); Stream<T2<L, Optional<R>>> leftOuterJoin(Index<K, R> other); Stream<T2<Optional<L>, R>> rightOuterJoin(Index<K, R> other); Stream<T2<L, R>> innerJoin(Index<K, R> other); Stream<T2<Optional<L>, Optional<R>>> outerJoin(Index<K, R> other); @Override String toString();  }