modified test in order not to depend on sorting order