Java, Eclipse Collections, Open Source, Primitive Collections, Java Stream Api.
LongSets.mutable::empty, // Supplier MutableLongSet::add, // ObjIntConsumer MutableLongSet::addAll); // BiConsumer; LongSet expected = LongSets.mutable.of(1L, 2L, 3L, 4L, 5L); Assertions.assertEquals(expected, longs); } This approach works with DoubleStream as well, and there are primitive Lists,