Java, Eclipse Collections, Open Source, Primitive Collections, Java Stream Api.
to a CharSet. @Test public void streamToCharSet() { Stream<Character> stream = Stream.of('a', 'b', 'c', 'd', 'e'); CharSet characters = stream.collect( Collectors2.collectChar( Character::charValue, CharSets.mutable::empty)); CharSet expected = CharSets.mutable.with('a', 'b', 'c', 'd', 'e');