Refactored sparse matrices comparison tests