// get filtered data
final List<JSONObject> data = this.find(conditions);
// order data
final String[] fieldNames = treeExpression.getGroupByFields();
if (!CollectionUtils.isEmpty(fieldNames)) {
Collections.sort(result, new JSONComparator(fieldNames));
}
// loop on all data
for (final JSONObject obj : data) {
try {
// add item to tree (list must be ordered)