compare operator impl & test & factory