title: Splitting a Hashmap into two smaller maps
body: <p>I have one hashmap with K, V value of  and that I want to split into two subMaps. </p>
  
  <blockquote>
    <p><code>HashMap&lt;Long,JSONObject&gt;</code></p>
  </blockquote>
  
  <p>One way is this I have found that we can use treemap and do subMapping.</p>
  
  <pre><code>TreeMap&lt;Integer, Integer&gt; sorted = new TreeMap&lt;Integer, Integer&gt;(bigMap);
  
  SortedMap&lt;Integer, Integer&gt; zeroToFortyNine = sorted.subMap(0, 50);
  SortedMap&lt;Integer, Integer&gt; fiftyToNinetyNine = sorted.subMap(50, 100);
  </code></pre>
  
  <p>But the thing is I am not getting subMap for jsonObject and I want to do it with HashMap only.</p>
  
  <p>Thanks</p>