Code review comment: please help change to ResourceManagerUtils.sleep

Code under review:
public void canCRUDRedisCache() throws Exception {
        
        Creatable<ResourceGroup> resourceGroups =
            resourceManager.resourceGroups().define(rgNameSecond).withRegion(Region.US_CENTRAL);

        Creatable<RedisCache> redisCacheDefinition1 =
            redisManager
                .redisCaches()
                .define(rrName)
                .withRegion(Region.ASIA_EAST)
                .withNewResourceGroup(rgName)
                .withBasicSku();
        Creatable<RedisCache> redisCacheDefinition2 =
            redisManager
                .redisCaches()
                .define(rrNameSecond)
                .withRegion(Region.US_CENTRAL)
                .withNewResourceGroup(resourceGroups)
                .withPremiumSku()
                .withShardCount(2)
                .withPatchSchedule(DayOfWeek.SUNDAY, 10, Duration.ofMinutes(302));
        Creatable<RedisCache> redisCacheDefinition3 =
            redisManager
                .redisCaches()
                .define(rrNameThird)
                .withRegion(Region.US_CENTRAL)
                .withNewResourceGroup(resourceGroups)
                .withPremiumSku(2)
                .withRedisConfiguration("maxclients", "2")
                .withNonSslPort()
                .withFirewallRule("rule1", "192.168.0.1", "192.168.0.4")
                .withFirewallRule("rule2", "192.168.0.10", "192.168.0.40");
        
        

        CreatedResources<RedisCache> batchRedisCaches =
            redisManager.redisCaches().create(redisCacheDefinition1, redisCacheDefinition2, redisCacheDefinition3);









        RedisCache redisCache = batchRedisCaches.get(redisCacheDefinition1.key());
        RedisCache redisCachePremium = batchRedisCaches.get(redisCacheDefinition3.key());
        Assertions.assertEquals(rgName, redisCache.resourceGroupName());
        Assertions.assertEquals(SkuName.BASIC, redisCache.sku().name());

        
        RedisCachePremium premiumCache = redisCachePremium.asPremium();
        Assertions.assertEquals(SkuFamily.P, premiumCache.sku().family());
        Assertions.assertEquals(2, premiumCache.firewallRules().size());
        Assertions.assertTrue(premiumCache.firewallRules().containsKey("rule1"));
        Assertions.assertTrue(premiumCache.firewallRules().containsKey("rule2"));

        
        premiumCache
            .update()
            .withRedisConfiguration("maxclients", "3")
            .withoutFirewallRule("rule1")
            .withFirewallRule("rule3", "192.168.0.10", "192.168.0.104")
            .withoutMinimumTlsVersion()
            .apply();
        Thread.sleep(10000);
        premiumCache.refresh();

        Assertions.assertEquals(2, premiumCache.firewallRules().size());
        Assertions.assertTrue(premiumCache.firewallRules().containsKey("rule2"));
        Assertions.assertTrue(premiumCache.firewallRules().containsKey("rule3"));
        Assertions.assertFalse(premiumCache.firewallRules().containsKey("rule1"));

        premiumCache.update().withoutRedisConfiguration("maxclients").apply();

        premiumCache.update().withoutRedisConfiguration().apply();

        Assertions.assertEquals(0, premiumCache.patchSchedules().size());
        premiumCache.update().withPatchSchedule(DayOfWeek.MONDAY, 1).withPatchSchedule(DayOfWeek.TUESDAY, 5).apply();

        Assertions.assertEquals(2, premiumCache.patchSchedules().size());
        
        premiumCache.forceReboot(RebootType.ALL_NODES);

        
        List<ScheduleEntry> patchSchedule = premiumCache.listPatchSchedules();
        Assertions.assertEquals(2, patchSchedule.size());

        premiumCache.deletePatchSchedule();

        patchSchedule = redisManager.redisCaches().getById(premiumCache.id()).asPremium().listPatchSchedules();
        Assertions.assertNull(patchSchedule);

        
        List<RedisCache> redisCaches =
            redisManager.redisCaches().listByResourceGroup(rgName).stream().collect(Collectors.toList());
        boolean found = false;
        for (RedisCache existingRedisCache : redisCaches) {
            if (existingRedisCache.name().equals(rrName)) {
                found = true;
            }
        }
        Assertions.assertTrue(found);
        Assertions.assertEquals(1, redisCaches.size());

        
        redisCaches = redisManager.redisCaches().list().stream().collect(Collectors.toList());
        found = false;
        for (RedisCache existingRedisCache : redisCaches) {
            if (existingRedisCache.name().equals(rrName)) {
                found = true;
            }
        }
        Assertions.assertTrue(found);
        Assertions.assertTrue(redisCaches.size() >= 3);

        
        RedisCache redisCacheGet = redisManager.redisCaches().getByResourceGroup(rgName, rrName);
        Assertions.assertNotNull(redisCacheGet);
        Assertions.assertEquals(redisCache.id(), redisCacheGet.id());
        Assertions.assertEquals(redisCache.provisioningState(), redisCacheGet.provisioningState());

        
        RedisAccessKeys redisKeys = redisCache.keys();
        Assertions.assertNotNull(redisKeys);
        Assertions.assertNotNull(redisKeys.primaryKey());
        Assertions.assertNotNull(redisKeys.secondaryKey());

        
        RedisAccessKeys oldKeys = redisCache.refreshKeys();
        RedisAccessKeys updatedPrimaryKey = redisCache.regenerateKey(RedisKeyType.PRIMARY);
        RedisAccessKeys updatedSecondaryKey = redisCache.regenerateKey(RedisKeyType.SECONDARY);
        Assertions.assertNotNull(oldKeys);
        Assertions.assertNotNull(updatedPrimaryKey);
        Assertions.assertNotNull(updatedSecondaryKey);
        if (!isPlaybackMode()) {
            Assertions.assertNotEquals(oldKeys.primaryKey(), updatedPrimaryKey.primaryKey());
            Assertions.assertEquals(oldKeys.secondaryKey(), updatedPrimaryKey.secondaryKey());
            Assertions.assertNotEquals(oldKeys.secondaryKey(), updatedSecondaryKey.secondaryKey());
            Assertions.assertNotEquals(updatedPrimaryKey.secondaryKey(), updatedSecondaryKey.secondaryKey());
            Assertions.assertEquals(updatedPrimaryKey.primaryKey(), updatedSecondaryKey.primaryKey());
        }

        
        redisCache = redisCache.update().withStandardSku().apply();
        Assertions.assertEquals(SkuName.STANDARD, redisCache.sku().name());
        Assertions.assertEquals(SkuFamily.C, redisCache.sku().family());

        try {
            redisCache.update().withBasicSku(1).apply();
            Assertions.fail();
        } catch (ManagementException e) {
            
        }

        
        redisCache.refresh();

        
        redisManager.redisCaches().deleteById(redisCache.id());

        
        
        
        
        
        
        
        
        /*premiumCache.exportData(storageAccount.name(),"snapshot1");

        premiumCache.importData(Arrays.asList("snapshot1"));*/
    }

Line commented on: Thread.sleep(10000);

Revised code:
public void canCRUDRedisCache() throws Exception {
        
        Creatable<ResourceGroup> resourceGroups =
            resourceManager.resourceGroups().define(rgNameSecond).withRegion(Region.US_CENTRAL);

        Creatable<RedisCache> redisCacheDefinition1 =
            redisManager
                .redisCaches()
                .define(rrName)
                .withRegion(Region.ASIA_EAST)
                .withNewResourceGroup(rgName)
                .withBasicSku();
        Creatable<RedisCache> redisCacheDefinition2 =
            redisManager
                .redisCaches()
                .define(rrNameSecond)
                .withRegion(Region.US_CENTRAL)
                .withNewResourceGroup(resourceGroups)
                .withPremiumSku()
                .withShardCount(2)
                .withPatchSchedule(DayOfWeek.SUNDAY, 10, Duration.ofMinutes(302));
        Creatable<RedisCache> redisCacheDefinition3 =
            redisManager
                .redisCaches()
                .define(rrNameThird)
                .withRegion(Region.US_CENTRAL)
                .withNewResourceGroup(resourceGroups)
                .withPremiumSku(2)
                .withRedisConfiguration("maxclients", "2")
                .withNonSslPort()
                .withFirewallRule("rule1", "192.168.0.1", "192.168.0.4")
                .withFirewallRule("rule2", "192.168.0.10", "192.168.0.40");
        
        

        CreatedResources<RedisCache> batchRedisCaches =
            redisManager.redisCaches().create(redisCacheDefinition1, redisCacheDefinition2, redisCacheDefinition3);









        RedisCache redisCache = batchRedisCaches.get(redisCacheDefinition1.key());
        RedisCache redisCachePremium = batchRedisCaches.get(redisCacheDefinition3.key());
        Assertions.assertEquals(rgName, redisCache.resourceGroupName());
        Assertions.assertEquals(SkuName.BASIC, redisCache.sku().name());

        
        RedisCachePremium premiumCache = redisCachePremium.asPremium();
        Assertions.assertEquals(SkuFamily.P, premiumCache.sku().family());
        Assertions.assertEquals(2, premiumCache.firewallRules().size());
        Assertions.assertTrue(premiumCache.firewallRules().containsKey("rule1"));
        Assertions.assertTrue(premiumCache.firewallRules().containsKey("rule2"));

        
        premiumCache
            .update()
            .withRedisConfiguration("maxclients", "3")
            .withoutFirewallRule("rule1")
            .withFirewallRule("rule3", "192.168.0.10", "192.168.0.104")
            .withoutMinimumTlsVersion()
            .apply();

        ResourceManagerUtils.sleep(Duration.ofSeconds(10));

        premiumCache.refresh();

        Assertions.assertEquals(2, premiumCache.firewallRules().size());
        Assertions.assertTrue(premiumCache.firewallRules().containsKey("rule2"));
        Assertions.assertTrue(premiumCache.firewallRules().containsKey("rule3"));
        Assertions.assertFalse(premiumCache.firewallRules().containsKey("rule1"));

        premiumCache.update().withoutRedisConfiguration("maxclients").apply();

        premiumCache.update().withoutRedisConfiguration().apply();

        Assertions.assertEquals(0, premiumCache.patchSchedules().size());
        premiumCache.update().withPatchSchedule(DayOfWeek.MONDAY, 1).withPatchSchedule(DayOfWeek.TUESDAY, 5).apply();

        Assertions.assertEquals(2, premiumCache.patchSchedules().size());
        
        premiumCache.forceReboot(RebootType.ALL_NODES);

        
        List<ScheduleEntry> patchSchedule = premiumCache.listPatchSchedules();
        Assertions.assertEquals(2, patchSchedule.size());

        premiumCache.deletePatchSchedule();

        patchSchedule = redisManager.redisCaches().getById(premiumCache.id()).asPremium().listPatchSchedules();
        Assertions.assertNull(patchSchedule);

        
        List<RedisCache> redisCaches =
            redisManager.redisCaches().listByResourceGroup(rgName).stream().collect(Collectors.toList());
        boolean found = false;
        for (RedisCache existingRedisCache : redisCaches) {
            if (existingRedisCache.name().equals(rrName)) {
                found = true;
            }
        }
        Assertions.assertTrue(found);
        Assertions.assertEquals(1, redisCaches.size());

        
        redisCaches = redisManager.redisCaches().list().stream().collect(Collectors.toList());
        found = false;
        for (RedisCache existingRedisCache : redisCaches) {
            if (existingRedisCache.name().equals(rrName)) {
                found = true;
            }
        }
        Assertions.assertTrue(found);
        Assertions.assertTrue(redisCaches.size() >= 3);

        
        RedisCache redisCacheGet = redisManager.redisCaches().getByResourceGroup(rgName, rrName);
        Assertions.assertNotNull(redisCacheGet);
        Assertions.assertEquals(redisCache.id(), redisCacheGet.id());
        Assertions.assertEquals(redisCache.provisioningState(), redisCacheGet.provisioningState());

        
        RedisAccessKeys redisKeys = redisCache.keys();
        Assertions.assertNotNull(redisKeys);
        Assertions.assertNotNull(redisKeys.primaryKey());
        Assertions.assertNotNull(redisKeys.secondaryKey());

        
        RedisAccessKeys oldKeys = redisCache.refreshKeys();
        RedisAccessKeys updatedPrimaryKey = redisCache.regenerateKey(RedisKeyType.PRIMARY);
        RedisAccessKeys updatedSecondaryKey = redisCache.regenerateKey(RedisKeyType.SECONDARY);
        Assertions.assertNotNull(oldKeys);
        Assertions.assertNotNull(updatedPrimaryKey);
        Assertions.assertNotNull(updatedSecondaryKey);
        if (!isPlaybackMode()) {
            Assertions.assertNotEquals(oldKeys.primaryKey(), updatedPrimaryKey.primaryKey());
            Assertions.assertEquals(oldKeys.secondaryKey(), updatedPrimaryKey.secondaryKey());
            Assertions.assertNotEquals(oldKeys.secondaryKey(), updatedSecondaryKey.secondaryKey());
            Assertions.assertNotEquals(updatedPrimaryKey.secondaryKey(), updatedSecondaryKey.secondaryKey());
            Assertions.assertEquals(updatedPrimaryKey.primaryKey(), updatedSecondaryKey.primaryKey());
        }

        
        redisCache = redisCache.update().withStandardSku().apply();
        Assertions.assertEquals(SkuName.STANDARD, redisCache.sku().name());
        Assertions.assertEquals(SkuFamily.C, redisCache.sku().family());

        try {
            redisCache.update().withBasicSku(1).apply();
            Assertions.fail();
        } catch (ManagementException e) {
            
        }

        
        redisCache.refresh();

        
        redisManager.redisCaches().deleteById(redisCache.id());

        
        
        
        
        
        
        
        
        /*premiumCache.exportData(storageAccount.name(),"snapshot1");

        premiumCache.importData(Arrays.asList("snapshot1"));*/
    }