Code example for NavigableMap

Methods: comparator

0
  @Override public void setUp() throws Exception { 
    super.setUp(); 
    navigableMap = (NavigableMap<K, V>) getMap();
    entries = Helpers.copyToList(getSubjectGenerator().getSampleElements(
        getSubjectGenerator().getCollectionSize().getNumElements())); 
    Collections.sort(entries, Helpers.<K, V>entryComparator(navigableMap.comparator()));
 
    // some tests assume SEVERAL == 3 
    if (entries.size() >= 1) {
      a = entries.get(0);
      if (entries.size() >= 3) {
        b = entries.get(1);
        c = entries.get(2);
      } 
    } 
  } 
 
  /** 
   * Resets the contents of navigableMap to have entries a, c, for the 
   * navigation tests. 
   */