function findFreePosition(source, element, position, getNextPosition) {
  var connectedAtPosition;

  while ((connectedAtPosition = getConnectedAtPosition(source, position, element))) {
    position = getNextPosition(element, position, connectedAtPosition);
  }

  return position;
}
Get free position starting from given position.

@param {Shape} source
@param {Shape} element
@param {Point} position
@param {(element: Element, position: Point, connectedAtPosition: Element) => Point} getNextPosition

@return {Point}