src/sap.ui.dt/src/sap/ui/dt/util/ZIndexManager.js
function () {
			//get all open popups from InstanceManager
			var aAllOpenPopups = fnGetPopups();
			var aValidatedPopups = [];
			var aInvalidatedPopups = [];

			aAllOpenPopups.forEach(function(oOpenPopup) {
				// check if non-adaptable popup
				var bValid = _aPopupFilters.every(function (fnFilter) {
					return fnFilter(oOpenPopup);
				});
				bValid && _aPopupFilters.length > 0
					? aValidatedPopups.push(oOpenPopup)
					: aInvalidatedPopups.push(oOpenPopup);
			});

			// get max Z-Index from validated popups
			var iMaxValidatedZIndex = aValidatedPopups.length > 0
				? Math.max.apply(null, fnGetZIndexFromPopups(aValidatedPopups))
				: -1;

			// get minimum Z-Index from invalidated popups
			var iMinInvalidatedZIndex = aInvalidatedPopups.length > 0
				? Math.min.apply(null, fnGetZIndexFromPopups(aInvalidatedPopups))
				: -1;

			// compare Z-Index of adaptable and non-adaptable popups - the higher one wins
			if (iMaxValidatedZIndex < iMinInvalidatedZIndex) {
				return this._getNextMinZIndex(iMinInvalidatedZIndex);
			} else {
				return Popup.getNextZIndex();
			}
		}
function () {
			//get all open popups from InstanceManager
			var aAllOpenPopups = fnGetPopups();
			var aValidatedPopups = [];
			var aInvalidatedPopups = [];

			aAllOpenPopups.forEach(function(oOpenPopup) {
				// check if non-adaptable popup
				var bValid = _aPopupFilters.every(function (fnFilter) {
					return fnFilter(oOpenPopup);
				});
				bValid && _aPopupFilters.length > 0
					? aValidatedPopups.push(oOpenPopup)
					: aInvalidatedPopups.push(oOpenPopup);
			});

			// get max Z-Index from validated popups
			var iMaxValidatedZIndex = aValidatedPopups.length > 0
				? Math.max.apply(null, fnGetZIndexFromPopups(aValidatedPopups))
				: -1;

			// get minimum Z-Index from invalidated popups
			var iMinInvalidatedZIndex = aInvalidatedPopups.length > 0
				? Math.min.apply(null, fnGetZIndexFromPopups(aInvalidatedPopups))
				: -1;

			// compare Z-Index of adaptable and non-adaptable popups - the higher one wins
			if (iMaxValidatedZIndex < iMinInvalidatedZIndex) {
				return this._getNextMinZIndex(iMinInvalidatedZIndex);
			} else {
				return Popup.getNextZIndex();
			}
		}
function ( ) { //get all open popups from InstanceManager var aAllOpenPopups = fnGetPopups ( ) ; var aValidatedPopups = [ ] ; var aInvalidatedPopups = [ ] ; aAllOpenPopups . forEach ( function ( oOpenPopup ) { // check if non-adaptable popup var bValid = _aPopupFilters . every ( function ( fnFilter ) { return fnFilter ( oOpenPopup ) ; } ) ; bValid && _aPopupFilters . length > 0 ? aValidatedPopups . push ( oOpenPopup ) : aInvalidatedPopups . push ( oOpenPopup ) ; } ) ; // get max Z-Index from validated popups var iMaxValidatedZIndex = aValidatedPopups . length > 0 ? Math . max . apply ( null , fnGetZIndexFromPopups ( aValidatedPopups ) ) : - 1 ; // get minimum Z-Index from invalidated popups var iMinInvalidatedZIndex = aInvalidatedPopups . length > 0 ? Math . min . apply ( null , fnGetZIndexFromPopups ( aInvalidatedPopups ) ) : - 1 ; // compare Z-Index of adaptable and non-adaptable popups - the higher one wins if ( iMaxValidatedZIndex < iMinInvalidatedZIndex ) { return this . _getNextMinZIndex ( iMinInvalidatedZIndex ) ; } else { return Popup . getNextZIndex ( ) ; } }
Calculates the reliable z-index in the current window considering the global BusyIndicator dialog.

Algorithm:
1) When popups are already open on the screen:
the highest z-index of validated popups is compared with the lowest z-index of invalidated popups.
The invalidated popups also include any BusyIndicator that might be open.
2) If the invalidated popups have the higher value then the next z-index is first decremented by 10,
which gives the last popup z-index and then 1 is added to it.
3) After incrementing 1 in Step 2), the resultant z-index value is compared against an array of assigned z-index values
by the ZIndexManager. Step 3) is repeated as long as it stays under a max value and a unique value is calculated.
The max value is the next possible popup z-index - 3 (hardcoded by variable Z_INDICES_RESERVED).
Example: when BusyIndicator has a z-index 100, then available indexes are:
91, 92, 93, 94, 95, 96, 97. Indexes 98 & 99 are used by
BusyIndicator internally, therefore we can't rely on them. The reason we start from
the index 91 is that in sap.ui.core.Popup.getNextZIndex() there is a hardcoded step with
a value 10 which means there are only 10 reliable indexes between the opened BusyIndicator
and the previous absolutely positioned element on the screen;
4) If no popups are open or if validated popups have a higher z-index,
then simply the next possible z-index is returned by calling sap.ui.core.Popup.getNextZIndex().

@returns {int} the next available z-index value
@public
Calculates the reliable z - index in the current window considering the global BusyIndicator dialog .