Added sort flags
Merge branch 'pull-request/collection-sortBy-flags' into 4.0