I'm trying to loop a JsonArray using Streams in java, I have looped a JsonObject Using the following code
jsonObject.entrySet().stream()
but there isn't no entrySet() class for JsonArray, How ever I tried using the iterator method but it only printed out one of the JsonObject inside of the JsonArray here is my attempt
.map(JsonArray::iterator)
.map(Iterator::next)
.forEach(System.out::println);
Edit: I'm getting the JsonArray from a JsonObject stream
.map(JsonArray.class::cast)
//need to handle jsonArray