title: Change comparator of treemap during runtime
body: <p>I see that the only way to set a comparator is via the TreeMap constructor.  For instance:</p>
  
  <pre><code> TreeMap myMap = new TreeMap(myComparator);
  </code></pre>
  
  <p>However, I would like to decide what type of comparator to use during runtime.  I could create multiple TreeMaps or a new instance of one, but I find that it leaves a bigger memory footprint.</p>
  
  <p>Is there a way to achieve this? Or is there a design flaw on my end?</p>