sorted set and tests