// Path: opfpush/src/main/java/org/onepf/opfpush/model/Operation.java
// public enum Operation {
//     REGISTER,
//     UNREGISTER
// }
// 
// Path: opfpush/src/test/java/org/onepf/opfpush/testutil/Util.java
// public final class Util {
// 
//     public static final int NUM_TESTS = 100;
//     public static final int NUM_PROVIDERS = 100;
//     public static final int RANDOM_STRING_LENGTH = 16;
//     private static final Random RND = new Random();
// 
//     private Util() {
//         throw new UnsupportedOperationException();
//     }
// 
//     public static List<String> shuffleStringArray(final String[] array) {
//         final List<String> mixedArray = Arrays.asList(array);
//         Collections.shuffle(mixedArray);
//         return mixedArray;
//     }
// 
//     public static String[] getRandomStrings(int n, int len) {
//         char[] chars = "abcdefghijklmnopqrstuvwxyz0123456789".toCharArray();
//         String[] strings = new String[n];
//         for (int i = 0; i < n; ++i) {
//             StringBuilder sb = new StringBuilder();
//             for (int j = 0; j < len; j++) {
//                 char c = chars[RND.nextInt(chars.length)];
//                 sb.append(c);
//             }
//             strings[i] = sb.toString();
//         }
//         return strings;
//     }
// 
//     public static PushProvider[] getRandomPushProviders() {
//         final MockNamePushProvider[] pushProviders = new MockNamePushProvider[NUM_PROVIDERS];
//         for (int i = 0; i < NUM_PROVIDERS; ++i) {
//             pushProviders[i] = new MockNamePushProvider(String.format("provider%d", i + 1));
//         }
//         return pushProviders;
//     }
// }


import android.annotation.TargetApi;
import android.os.Build;
import android.util.Log;
import junit.framework.Assert;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.onepf.opfpush.model.Operation;
import org.onepf.opfpush.testutil.Util;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import java.lang.reflect.Field;
import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR2;
    private InfinityExponentialBackoffManager manager;

    @Before
    public void setUp() {
        manager = InfinityExponentialBackoffManager.getInstance();
    }

    @TargetApi(Build.VERSION_CODES.KITKAT)
    @After
    public void eraseSettingsInstance() {
        synchronized (InfinityExponentialBackoffManager.class) {
            try {
                final Field instanceField = InfinityExponentialBackoffManager.class.getDeclaredField("instance");
                instanceField.setAccessible(true);
                instanceField.set(null, null);
            } catch (IllegalAccessException | NoSuchFieldException e) {
                Log.e(TAG, e.getMessage());
            }
        }
    }

    @Test
    public void testGetInstance() {
        eraseSettingsInstance();
        manager = InfinityExponentialBackoffManager.getInstance();
        assertEquals(manager, InfinityExponentialBackoffManager.getInstance());
    }

    @Test
    public void testHasTries() {
// Path: opfpush/src/main/java/org/onepf/opfpush/model/Operation.java
// public enum Operation {
//     REGISTER,
//     UNREGISTER
// }
// 
// Path: opfpush/src/test/java/org/onepf/opfpush/testutil/Util.java
// public final class Util {
// 
//     public static final int NUM_TESTS = 100;
//     public static final int NUM_PROVIDERS = 100;
//     public static final int RANDOM_STRING_LENGTH = 16;
//     private static final Random RND = new Random();
// 
//     private Util() {
//         throw new UnsupportedOperationException();
//     }
// 
//     public static List<String> shuffleStringArray(final String[] array) {
//         final List<String> mixedArray = Arrays.asList(array);
//         Collections.shuffle(mixedArray);
//         return mixedArray;
//     }
// 
//     public static String[] getRandomStrings(int n, int len) {
//         char[] chars = "abcdefghijklmnopqrstuvwxyz0123456789".toCharArray();
//         String[] strings = new String[n];
//         for (int i = 0; i < n; ++i) {
//             StringBuilder sb = new StringBuilder();
//             for (int j = 0; j < len; j++) {
//                 char c = chars[RND.nextInt(chars.length)];
//                 sb.append(c);
//             }
//             strings[i] = sb.toString();
//         }
//         return strings;
//     }
// 
//     public static PushProvider[] getRandomPushProviders() {
//         final MockNamePushProvider[] pushProviders = new MockNamePushProvider[NUM_PROVIDERS];
//         for (int i = 0; i < NUM_PROVIDERS; ++i) {
//             pushProviders[i] = new MockNamePushProvider(String.format("provider%d", i + 1));
//         }
//         return pushProviders;
//     }
// }


// Path: opfpush/src/test/java/org/onepf/opfpush/backoff/InfinityExponentialBackoffManagerTest.java
import android.annotation.TargetApi;
import android.os.Build;
import android.util.Log;
import junit.framework.Assert;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.onepf.opfpush.model.Operation;
import org.onepf.opfpush.testutil.Util;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import java.lang.reflect.Field;
import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR2;

    private InfinityExponentialBackoffManager manager;

    @Before
    public void setUp() {
        manager = InfinityExponentialBackoffManager.getInstance();
    }

    @TargetApi(Build.VERSION_CODES.KITKAT)
    @After
    public void eraseSettingsInstance() {
        synchronized (InfinityExponentialBackoffManager.class) {
            try {
                final Field instanceField = InfinityExponentialBackoffManager.class.getDeclaredField("instance");
                instanceField.setAccessible(true);
                instanceField.set(null, null);
            } catch (IllegalAccessException | NoSuchFieldException e) {
                Log.e(TAG, e.getMessage());
            }
        }
    }

    @Test
    public void testGetInstance() {
        eraseSettingsInstance();
        manager = InfinityExponentialBackoffManager.getInstance();
        assertEquals(manager, InfinityExponentialBackoffManager.getInstance());
    }

    @Test
    public void testHasTries() {
        for (int i = 0; i < Util.NUM_TESTS; ++i) {