private static function checkKeyPathIsValidAndNonEmpty($keyPath)
    {
        if (!is_string($keyPath) && !is_int($keyPath)) {
            throw new BadKeyPath($keyPath);
        }
        if (strlen(strval($keyPath)) === 0) {
            throw new BadKeyPath($keyPath);
        }
    }