Why not parameterize the TreeMap constructor instead?