added unit test for comparator