Refactored tests on sets