Use this tag for questions related to the use of the Stream API.
Imagine these classes class Subject { private int id; private Type type; private String origin; private String name; Subject(int id, …
java-8 java-stream collectorsJava 8 introduced a Stream class that resembles Scala's Stream, a powerful lazy construct using which it is possible to do …
java scala java-8 java-stream sieveI have read the topic: Collectors.groupingBy doesn't accept null keys But I don't understand how can I apply it …
java java-8 grouping java-streamI want to collect the stream to a LinkedHashMap<String, Object>. I have a JSON resource that is …
java hashmap java-stream linkedhashmapI'm trying to use in place of bitmask below is the code public static Set<Amenities> fromBitFlags(int …
java java-8 java-stream enumsetTake a look at this piece of code. // group by price, uses 'mapping' to convert List<Item> to …
java java-8 java-stream collectorsWhile playing around with Java8's Streams-API, I stumbled over the following: To convert an array of primitive wrapper classe …
java wrapper java-8 primitive-types java-streamThe javadoc for Stream states: Streams have a BaseStream.close() method and implement AutoCloseable, but nearly all stream instances do …
java stream java-8 java-stream resource-leakDo we have any aggregator function in Java to perform the below aggregation? Person { String name; String subject; String department; …
java java-8 aggregate-functions java-streamI have the following code: Stream.of("1,2,3,4".split(",")).mapToDouble(Double::valueOf).collect(Collectors.toList()); I want to return List<…
java java-8 java-stream collect