fix unit tests

needed to sort lists
and set priority flags

Change-Id: I39fb63f732d3d36c3bb550e9325fa03577b0c9c0