@Override
public Object filter(Object obj, Configuration configuration) {
JsonProvider jsonProvider = configuration.getProvider();
Iterable<Object> src = null;
try {
src = jsonProvider.toIterable(obj);
} catch (ClassCastException e){
throw new PathNotFoundException("The path fragment '" + this.condition + "' can not be applied to a JSON object only a JSON array.", e);
}
Object result = jsonProvider.createArray();
for (Object item : src) {