Use the closest mapping in the store when there's gaps.
- Pick the first element in the fragment bigger than
  requested mapping id when failing to find the element.
- Added unit tests.

#1973