assert !ranges.isEmpty();
GridGgfsFileAffinityRange last = ranges.get(ranges.size() - 1);
// Ensure that range being added is located to the right of last range in list.
assert last.greater(range.startOffset()) : "Cannot add range to middle of map [last=" + last +
", range=" + range + ']';
// Try to concat last and new range.
GridGgfsFileAffinityRange concat = last.concat(range);