RangeIndex extends MultiValueIndex { protected List<Object> higher(NavigableMap<Object, Set<Object>> map, Entry<Object, Set<Object>> current) { Set<Object> resultSet = new HashSet<Object>(); while (current != null) { synchronized (current) { resultSet.addAll(current.getValue()); current = map.higherEntry(current.getKey()); } } return new ArrayList<Object>(resultSet); } RangeIndex(); List<Object> lessThan(Object value); List<Object> lessThanOrEqualsTo(Object value); List<Object> greaterThan(Object value); List<Object> greaterThanOrEqualsTo(Object value); @SuppressWarnings("unchecked") List<Object> between(Object lowerBound, Object upperBound); NavigableMap<Object, Set<Object>> getMap();  }
@Test public void higher() { Object key = new Object(); Object value = new Object(); Set<Object> set = new HashSet<Object>(); set.add(value); doReturn(set).when(entry).getValue(); doReturn(key).when(entry).getKey(); doReturn(null).when(map).higherEntry(key); List<Object> actualObjects = rangeIndex.higher(map, entry); assertEquals(value, actualObjects.get(0)); }