Java, Eclipse Collections, Open Source, Primitive Collections, Java Stream Api.
Stream<BigDecimal> stream = Stream.of( BigDecimal.ZERO, BigDecimal.ONE, BigDecimal.TWO, BigDecimal.TEN); FloatSet floats = stream.collect( Collectors2.collectFloat( BigDecimal::floatValue, FloatSets.mutable::empty)); FloatSet expected = FloatSets.mutable.with(0.0f, 1.0f, 2.0f, 10.0f);