/* * {@inheritDoc} * * @see java.util.NavigableSet#headSet(Object, boolean) * @since 1.6 */ public NavigableSet <E> headSet(E end, bool endInclusive) { // Check for errors Comparator <E> c = backingMap.comparator(); if (c == null) { ((java.lang.Comparable <E>)end).compareTo(end); } else { c.compare(end, end); } return(new TreeSet <E>(backingMap.headMap(end, endInclusive))); }