When result of parse(ctx) is type of map, it's failing with following error:
class java.util.LinkedHashMap cannot be cast to class java.util.Collection (java.util.LinkedHashMap and java.util.Collection are in module java.base of loader 'bootstrap')
It's showing because Map doesn't implement Collection interface.
Issue copied from: https://github.com/json-path/JsonPath/issues/843
Unit tests: https://github.com/pbugara/JsonPath/commit/9111d376247c57a799f1936e7d672352507869ab
I found bug in ValueNodes interface in method isEmpty: https://github.com/json-path/JsonPath/blob/master/json-path/src/main/java/com/jayway/jsonpath/internal/filter/ValueNodes.java#L173
When result of parse(ctx) is type of map, it's failing with following error: class java.util.LinkedHashMap cannot be cast to class java.util.Collection (java.util.LinkedHashMap and java.util.Collection are in module java.base of loader 'bootstrap')
It's showing because Map doesn't implement Collection interface.