// Path: Drop-In/src/sharedTest/java/com/braintreepayments/api/Assertions.java
// public static void assertIsANonce(String maybeANonce) {
//     assertNotNull("Nonce was null", maybeANonce);
//     assertTrue("Does not match the expected form of a nonce. Expected \"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$\" got \"" + maybeANonce + "\"",
//             maybeANonce.matches("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"));
// }
// 
// Path: Drop-In/src/sharedTest/java/com/braintreepayments/api/CardNumber.java
// public static final String VISA = "4111111111111111";
// 
// Path: Drop-In/src/sharedTest/java/com/braintreepayments/api/ExpirationDate.java
// public static String validExpirationYear() {
//     return String.valueOf(Calendar.getInstance().get(Calendar.YEAR) + 1).substring(2);
// }


import static com.braintreepayments.api.Assertions.assertIsANonce;
import static com.braintreepayments.api.CardNumber.VISA;
import static com.braintreepayments.api.ExpirationDate.validExpirationYear;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertNull;
import static junit.framework.Assert.assertTrue;
import static junit.framework.Assert.fail;
import android.content.Context;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.util.concurrent.CountDownLatch;

            sut.getPaymentMethodNonces((paymentMethodNonces, getPaymentMethodNoncesError) -> {
                assertNull(getPaymentMethodNoncesError);
                assertNotNull(paymentMethodNonces);
                assertEquals(1, paymentMethodNonces.size());

                PaymentMethodNonce paymentMethodNonce = paymentMethodNonces.get(0);

                assertIsANonce(paymentMethodNonce.getString());

                sut.deletePaymentMethod(context, paymentMethodNonce, (deletedNonce, deletePaymentMethodError) -> {
                    assertNull(deletePaymentMethodError);
                    assertTrue(deletedNonce instanceof CardNonce);
                    latch.countDown();
                });
            });
        });

        latch.await();
    }

    @Test(timeout = 10000)
    public void getPaymentMethodNonces_failsWithATokenizationKey() throws InterruptedException {
        final CountDownLatch latch = new CountDownLatch(1);

        final BraintreeClient braintreeClient = new BraintreeClient(context, Fixtures.TOKENIZATION_KEY);
        CardClient cardClient = new CardClient(braintreeClient);
        final PaymentMethodClient sut = new PaymentMethodClient(braintreeClient);

        Card card = new Card();
// Path: Drop-In/src/sharedTest/java/com/braintreepayments/api/Assertions.java
// public static void assertIsANonce(String maybeANonce) {
//     assertNotNull("Nonce was null", maybeANonce);
//     assertTrue("Does not match the expected form of a nonce. Expected \"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$\" got \"" + maybeANonce + "\"",
//             maybeANonce.matches("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"));
// }
// 
// Path: Drop-In/src/sharedTest/java/com/braintreepayments/api/CardNumber.java
// public static final String VISA = "4111111111111111";
// 
// Path: Drop-In/src/sharedTest/java/com/braintreepayments/api/ExpirationDate.java
// public static String validExpirationYear() {
//     return String.valueOf(Calendar.getInstance().get(Calendar.YEAR) + 1).substring(2);
// }


// Path: Drop-In/src/androidTest/java/com/braintreepayments/api/PaymentMethodClientTest.java
import static com.braintreepayments.api.Assertions.assertIsANonce;
import static com.braintreepayments.api.CardNumber.VISA;
import static com.braintreepayments.api.ExpirationDate.validExpirationYear;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertNull;
import static junit.framework.Assert.assertTrue;
import static junit.framework.Assert.fail;
import android.content.Context;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.util.concurrent.CountDownLatch;


            sut.getPaymentMethodNonces((paymentMethodNonces, getPaymentMethodNoncesError) -> {
                assertNull(getPaymentMethodNoncesError);
                assertNotNull(paymentMethodNonces);
                assertEquals(1, paymentMethodNonces.size());

                PaymentMethodNonce paymentMethodNonce = paymentMethodNonces.get(0);

                assertIsANonce(paymentMethodNonce.getString());

                sut.deletePaymentMethod(context, paymentMethodNonce, (deletedNonce, deletePaymentMethodError) -> {
                    assertNull(deletePaymentMethodError);
                    assertTrue(deletedNonce instanceof CardNonce);
                    latch.countDown();
                });
            });
        });

        latch.await();
    }

    @Test(timeout = 10000)
    public void getPaymentMethodNonces_failsWithATokenizationKey() throws InterruptedException {
        final CountDownLatch latch = new CountDownLatch(1);

        final BraintreeClient braintreeClient = new BraintreeClient(context, Fixtures.TOKENIZATION_KEY);
        CardClient cardClient = new CardClient(braintreeClient);
        final PaymentMethodClient sut = new PaymentMethodClient(braintreeClient);

        Card card = new Card();
        card.setNumber(VISA);