The abstraction above would help with the duplicate check here, where you'd delegate the "matches()" call over to the object in question.