title: Get first and last element from a HashMap
body: <p>I have the following code and I'd like to get able to get the first and last element from the Map and assign each to a String.</p>
  
  <pre><code>String result1stElement = null;
  String resultLastElement = null;
  
  Map&lt;String, String&gt; result = new HashMap&lt;String, String&gt;();
  result = myModel.getSampleResults();
  </code></pre>
  
  <p>Any ideas.</p>
  
  <p>Thanks in advance.</p>