- toStream() method returns a stream of JSONObjects inside the input JSONObject. It returns the elements in DFS manner.
For example, the input JSONObject is as follows:
{"contact": { "nick": "Crista", "address": { "zipcode": 92614, "street": "Ave of Nowhere" }, "name": "Crista Lopes" }}
The expected output stream should look like this:
{"contact":{"nick":"Crista","address":{"zipcode":92614,"street":"Ave of Nowhere"},"name":"Crista Lopes"}} {"nick":"Crista"} {"address":{"zipcode":92614,"street":"Ave of Nowhere"}} {"zipcode":92614} {"street":"Ave of Nowhere"} {"name":"Crista Lopes"}
testForEach()
at line 19 ~ 34
testFilter()
at line 38 ~ 51
testMap()
at line 54 ~ 63