Java, Eclipse Collections, Open Source, Primitive Collections, Java Stream Api.
streamToBooleanBag() { Stream<String> stream = Stream.of("true", "false", "true", "false", "true"); BooleanBag booleans = stream.collect( Collectors2.collectBoolean( Boolean::parseBoolean, BooleanBags.mutable::empty)); Assertions.assertEquals(3, booleans.occurrencesOf(true));