class SortedRangeList implements Iterable<Range> {

	public int getRangeIndex(int value) {
		Range key = new Range(value, value);
		SortedSet<Range> head = set.headSet(key);
		int index = head.size() - 1;
		if (!head.isEmpty()) {
			Range last = head.last();
			if (last.max >= value) {
				return index;
			}
		}
		index++;
		SortedSet<Range> tail = set.tailSet(key);
		if (!tail.isEmpty()) {
			Range range = tail.first();
			if (range.min == value) {
				return index;
			}
		}
		return -index - 1;
	}

	public  SortedRangeList();
	public  SortedRangeList(SortedRangeList list);

}