### Question:
Optionals { public static <T> Optional<Collection<T>> of(Collection<T> collection) { return collection.isEmpty() ? Optional.empty() : Optional.of(collection); }  static Optional<Collection<T>> of(Collection<T> collection); static Stream<T> stream(Optional<T> optional);  }### Answer:
@Test public void testOfEmptyCollection() { assertThat(Optionals.of(Collections.emptyList())).isEmpty(); }
@Test public void testOfCollection() { Assert.assertThat(Optionals.of(Arrays.asList(1, 2)), isPresentAnd(hasSize(2))); Assert.assertThat(Optionals.of(Arrays.asList(1, 2)), isPresentAnd(hasItems(1, 2))); }