parameterize `TreeMap` and `TreeSet` with a comparator