Stability tests and common test suite for sorting