protected function getNewWindow($sessionHandleList)
    {
        $newSessionHandleList = $this->getSessionWindowHandles();
        $sessionHandleCount = count($sessionHandleList);
        $newSessionHandleCount = count($newSessionHandleList);
        $newWindowHandleList = array_diff($newSessionHandleList, $sessionHandleList);
        if ($newSessionHandleCount - $sessionHandleCount == 1 && count($newWindowHandleList) == 1) {
            /**
             * If amount of current session handles increments exactly by 1 and new handle only 1 -
             * this is new window handle.
             */
            return array_shift($newWindowHandleList);
        } elseif ($newSessionHandleCount == $sessionHandleCount && count($newWindowHandleList) == 0) {
            return;
        } else {
            throw new WebDriver_Exception(
                "Unexpected behaviour while waiting for new window: \n" .
                "Handles before wait started: " . var_export($sessionHandleList, true) . "\n" .
                "Handles current: " . var_export($newSessionHandleList, true)
            );
        }
    }