Printing values from map based on index
<p>If I have following map:</p>

<pre><code> NavigableMap&lt;Integer,String&gt; nmap = 
        new TreeMap&lt;Integer,String&gt;(); 

    nmap.put(3, "Three"); 
    nmap.put(1, "One"); 
    nmap.put(4, "Four"); 
    nmap.put(5, "Five"); 
    nmap.put(7, "Seven"); 
    nmap.put(10, "Ten"); 


System.out.println(nmap); 
// {1=One, 3=Three, 4=Four, 5=Five, 7=Seven, 10=Ten} 
</code></pre>

<p>Is there a mechanism, that can allow me to print this, printing by index value, if index is smaller more than 1 from the following index print -(dash):</p>

<blockquote>
  <p>One,-,Three,Four,Five,-,Six,Seven,-,-,Ten</p>
</blockquote>

<p>How would I write function for this?</p>

<p>I don't have to print whole map to string I meant for each key/value pair</p>
