public static < T > Map < Boolean , List < T > > toMapPartition ( Stream < T > stream , Predicate < T > predicate ) { return stream . collect ( Collectors . partitioningBy ( predicate ) ) ; }
Split a stream into a map with true and false .