merge `TreeSet` impls