// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.security.keyvault.secrets;

import com.azure.identity.credential.DefaultAzureCredential;
import com.azure.identity.credential.DefaultAzureCredentialBuilder;
import com.azure.identity.credential.SharedTokenCacheCredential;
import com.azure.identity.credential.SharedTokenCacheCredentialBuilder;
import com.azure.security.keyvault.secrets.models.Secret;

/**
 * Sample showing how to authenticate to key vault with a shared token cache credential.
 */
public class PersistentTokenCacheDemo {

    /**
     * Authenticates from shared token cache and gets a secret.
     * @param args Unused. Arguments to the program.
     */
    public static void main(String[] args) {

        // Wrote to AZURE_USERNAME env variable
        SharedTokenCacheCredential defaultCredential = new SharedTokenCacheCredentialBuilder().clientId("04b07795-8ddb-461a-bbee-02f9e1bf7b46").build();

        SecretClient client = new SecretClientBuilder()
            .endpoint("https://persistentcachedemo.vault.azure.net")
            .credential(defaultCredential)
            .buildClient();

        // Try to get a secret! Only works if you are logged in
        System.out.println("\nWhat is the super secret secret?\n\n");
        Secret secret = client.getSecret("the-secret");
        System.out.println("Secret was found: " + secret.value());
    }
}

@@ -140,137 +140,8 @@
 s;%0A%0A
-import com.azure.identity.credential.DefaultAzureCredential;%0Aimport com.azure.identity.credential.DefaultAzureCredentialBuilder;%0A
 impo
@@ -791,16 +791,29 @@
 uilder()
+%0A            
 .clientI
@@ -853,16 +853,29 @@
 bf7b46%22)
+%0A            
 .build()

Remove unused imports. (#5293)