Added unit tests for sort feature.