Java, Eclipse Collections, Open Source, Primitive Collections, Java Stream Api.
int literal to a short. The Sh record allowed me to cast in one place. @Test public void streamToShortBag() { record Sh(short value) { public Sh(int intValue) { this((short) intValue); } }; Stream<Sh> stream = Stream.of(new Sh(1), new Sh(2), new Sh(3), new Sh(4), new Sh(5)); ShortBag shorts =