headSet()/tailSet() issue when dealing with descending sets
<p>I have the following code snippet:</p>

<pre><code>class Cert {
public static void main(String[] args) throws IOException {
    NavigableSet&lt;Integer&gt; navigableSet = new TreeSet&lt;Integer&gt;();
    List a = new ArrayList&lt;Integer&gt;();
    a.add(1);
    a.add(2);
    a.add(-1);
    navigableSet.addAll(a);
    Iterator&lt; Integer&gt; iterator = navigableSet.descendingSet().headSet(1).iterator();
    while (iterator.hasNext())
    {
        System.out.print(iterator.next() + " ");
    }
}
</code></pre>

<p>}</p>

<p>This code returns "2". But here's what the official javadoc (Java 6) for headSet says:</p>

<blockquote>
  <p>SortedSet headSet(E toElement)
  Returns a view of the portion of this set whose elements are strictly less than toElement. The returned set is backed by this set, so changes in the returned set are reflected in this set, and vice-versa. The returned set supports all optional set operations that this set supports.</p>
</blockquote>

<p>According to the above, the program should print only "-1". Did the javadoc forget the descending case?</p>

<p>Thanks in advance</p>
