### Question:
CollectionUtils { public static <T> Collection<Tuple2<T, T>> crossProduct(List<T> list) { Builder<Tuple2<T, T>> result = ImmutableList.builder(); int size = list.size(); for (int i = 0; i < size; i++) { T left = list.get(i); Iterable<T> remaining = list.subList(i, size); Seq.of(left) .crossJoin(remaining) .forEach(result::add); } return result.build(); }  static List<T> asList(T obj); static IntSet mutableSingleton(int i); static Optional<Entry<V>> ceilingEntry(Double2ObjectSortedMap<V> sortedMap,
		double from); static Optional<V> ceilingValue(Double2ObjectSortedMap<V> sortedMap, double from); static Collection<Tuple2<T, T>> crossProduct(List<T> list); static OptionalDouble first(DoubleSortedSet set); static void forEach(Double2ObjectMap<V> map, DoubleObjectBiConsumer<V> action); static void forEach(Int2ObjectMap<V> map, IntObjectBiConsumer<V> action); static Optional<T> head(List<T> clusters); static Optional<IntCollection> intersection(Collection<IntCollection> clusters); static IntSet merge(IntSet left, IntCollection right); static IntCollection merge(IntCollection left, IntCollection right); static Collection<T> merge(Collection<T> left, Collection<T> right); static Predicate<Collection<T>> sizeBelow(int maxSize); static List<T> sort(Collection<T> collection, Comparator<T> comparator); static Collection<T> tail(List<T> clusters); static Collection<String> toString(Iterable<T> objects);  }### Answer:
@Test public void testCrossProduct() { assertThat(CollectionUtils.crossProduct(Arrays.asList(1, 2, 3))).hasSize(1 + 2 + 3); assertThat(CollectionUtils.crossProduct(Arrays.asList(1, 2, 3))) .contains(Tuple.tuple(1, 1)); assertThat(CollectionUtils.crossProduct(Arrays.asList(1, 2, 3))) .contains(Tuple.tuple(1, 2)); assertThat(CollectionUtils.crossProduct(Arrays.asList(1, 2, 3))) .contains(Tuple.tuple(1, 3)); assertThat(CollectionUtils.crossProduct(Arrays.asList(1, 2, 3))) .contains(Tuple.tuple(2, 2)); assertThat(CollectionUtils.crossProduct(Arrays.asList(1, 2, 3))) .contains(Tuple.tuple(2, 3)); assertThat(CollectionUtils.crossProduct(Arrays.asList(1, 2, 3))) .contains(Tuple.tuple(3, 3)); }