public async Task TestGetSparkSession()
        {
            SparkSessionCollection sparkSessions = (await SparkSessionClient.GetSparkSessionsAsync()).Value;

            foreach (SparkSession expectedSparkSession in sparkSessions.Sessions)
            {
                SparkSession actualSparkSession = await SparkSessionClient.GetSparkSessionAsync(expectedSparkSession.Id);

                ValidateSparkSession(expectedSparkSession, actualSparkSession);
            }
        }
        public static async Task <List <SparkSession> > ListSparkSessionsAsync(SparkSessionClient client, bool detailed = true)
        {
            List <SparkSession> sessions = new List <SparkSession>();
            int from = 0;
            int currentPageSize;
            int pageSize = 20;

            do
            {
                SparkSessionCollection page = (await client.GetSparkSessionsAsync(detailed: detailed, from: from, size: pageSize)).Value;
                currentPageSize = page.Total;
                from           += currentPageSize;
                sessions.AddRange(page.Sessions);
            } while (currentPageSize == pageSize);

            return(sessions);
        }