function getContainerAnnotationsForSelection (doc, sel, containerPath, options) {
  // ATTENTION: looking for container annotations is not as efficient as property
  // selections, as we do not have an index that has notion of the spatial extend
  // of an annotation. Opposed to that, common annotations are bound
  // to properties which make it easy to lookup.
  /* istanbul ignore next */
  if (!containerPath) {
    throw new Error("'containerPath' is required.")
  }
  options = options || {}
  const index = doc.getIndex('container-annotations')
  let annotations = []
  if (index) {
    annotations = index.get(containerPath, options.type)
    annotations = filter(annotations, function (anno) {
      return sel.overlaps(anno.getSelection())
    })
  }
  return annotations
}
For a given selection get all container annotations

  @param {Document} doc
  @param {Selection} sel
  @param {String} containerPath
  @param {String} options.type provides only annotations of that type
  @return {Array} An array of container annotations