Implement and test distinct operator