// Path: opfpush/src/test/java/org/onepf/opfpush/mock/MockNamePushProvider.java
// public class MockNamePushProvider extends BasePushProvider {
// 
//     public static final String DEFAULT_HOST_APP_PACKAGE = "org.onepf.store";
// 
//     public MockNamePushProvider(@NonNull String name) {
//         this(name, DEFAULT_HOST_APP_PACKAGE);
//     }
// 
//     public MockNamePushProvider(@NonNull String name,
//                                 @NonNull String hostAppPackage) {
//         super(RuntimeEnvironment.application, name, hostAppPackage);
//     }
// 
//     @Override
//     public void register() {
//         //nothing
//     }
// 
//     @Override
//     public void unregister() {
//         //nothing
//     }
// 
//     @Override
//     public void onRegistrationInvalid() {
//         //nothing
//     }
// 
//     @Override
//     public void onUnavailable() {
//         //nothing
//     }
// 
//     @Override
//     public boolean isRegistered() {
//         return false;
//     }
// 
//     @Nullable
//     @Override
//     public String getRegistrationId() {
//         return null;
//     }
// }
// 
// Path: opfpush/src/main/java/org/onepf/opfpush/pushprovider/PushProvider.java
// public interface PushProvider {
//     /**
//      * Initiates the registration of the provider. Must be async.
//      * <p/>
//      * Intended for the internal use, should never be called directly.
//      * To start the registration call {@link org.onepf.opfpush.OPFPushHelper#register()}.
//      */
//     void register();
// 
//     /**
//      * Initiates the unregistering of the provider. Must be async.
//      * <p/>
//      * Intended for internal use, should never be called directly.
//      * To start registration call {@link org.onepf.opfpush.OPFPushHelper#unregister()}.
//      */
//     void unregister();
// 
//     /**
//      * Checks whether the provider is available.
//      *
//      * @return The instance of {@link org.onepf.opfpush.model.AvailabilityResult}
//      * that contains result of availability check.
//      */
//     @NonNull
//     AvailabilityResult getAvailabilityResult();
// 
//     /**
//      * Checks whether the application was successfully registered on the service.
//      *
//      * @return {@code true} if the application was successfully registered on the service, otherwise false.
//      */
//     boolean isRegistered();
// 
//     /**
//      * Returns the registration ID or null if provider isn't registered.
//      *
//      * @return The registration ID or null if provider isn't registered.
//      */
//     @Nullable
//     String getRegistrationId();
// 
//     /**
//      * Returns the name of the provider. Must be unique for all providers.
//      *
//      * @return The name of the provider.
//      */
//     @NonNull
//     String getName();
// 
//     /**
//      * Returns the package of the application that contains API of the provider.
//      * Usually, this is a store application.
//      *
//      * @return The package of the application that contains API of the provider.
//      */
//     @Nullable
//     String getHostAppPackage();
// 
//     /**
//      * Returns the {@link NotificationMaker} object associated with provider.
//      *
//      * @return The {@link NotificationMaker} instance.
//      */
//     @NonNull
//     NotificationMaker getNotificationMaker();
// 
//     /**
//      * Verify that application manifest contains all needed permissions.
//      *
//      * @param checkManifestHandler If not null an exception isn't thrown.
//      * @throws java.lang.IllegalStateException If not all required permissions and components have been
//      *                                         described in the AndroidManifest.xml file.
//      */
//     void checkManifest(@Nullable CheckManifestHandler checkManifestHandler);
// 
//     /**
//      * Callback method, that called when the application state change, like update to new version,
//      * or system state changed, like update firmware to a newer version.
//      * <p/>
//      * If this method is called, your registration becomes invalid
//      * and you have to reset all saved registration data.
//      */
//     void onRegistrationInvalid();
// 
//     /**
//      * Callback method for notify that the provider became unavailable.
//      * In this method you have to reset all saved registration data.
//      */
//     void onUnavailable();
// }


import org.onepf.opfpush.mock.MockNamePushProvider;
import org.onepf.opfpush.pushprovider.PushProvider;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Random;
package org.onepf.opfpush.testutil;



/**
 * @author antonpp
 * @since 13.04.15
 */
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;
    }

// Path: opfpush/src/test/java/org/onepf/opfpush/mock/MockNamePushProvider.java
// public class MockNamePushProvider extends BasePushProvider {
// 
//     public static final String DEFAULT_HOST_APP_PACKAGE = "org.onepf.store";
// 
//     public MockNamePushProvider(@NonNull String name) {
//         this(name, DEFAULT_HOST_APP_PACKAGE);
//     }
// 
//     public MockNamePushProvider(@NonNull String name,
//                                 @NonNull String hostAppPackage) {
//         super(RuntimeEnvironment.application, name, hostAppPackage);
//     }
// 
//     @Override
//     public void register() {
//         //nothing
//     }
// 
//     @Override
//     public void unregister() {
//         //nothing
//     }
// 
//     @Override
//     public void onRegistrationInvalid() {
//         //nothing
//     }
// 
//     @Override
//     public void onUnavailable() {
//         //nothing
//     }
// 
//     @Override
//     public boolean isRegistered() {
//         return false;
//     }
// 
//     @Nullable
//     @Override
//     public String getRegistrationId() {
//         return null;
//     }
// }
// 
// Path: opfpush/src/main/java/org/onepf/opfpush/pushprovider/PushProvider.java
// public interface PushProvider {
//     /**
//      * Initiates the registration of the provider. Must be async.
//      * <p/>
//      * Intended for the internal use, should never be called directly.
//      * To start the registration call {@link org.onepf.opfpush.OPFPushHelper#register()}.
//      */
//     void register();
// 
//     /**
//      * Initiates the unregistering of the provider. Must be async.
//      * <p/>
//      * Intended for internal use, should never be called directly.
//      * To start registration call {@link org.onepf.opfpush.OPFPushHelper#unregister()}.
//      */
//     void unregister();
// 
//     /**
//      * Checks whether the provider is available.
//      *
//      * @return The instance of {@link org.onepf.opfpush.model.AvailabilityResult}
//      * that contains result of availability check.
//      */
//     @NonNull
//     AvailabilityResult getAvailabilityResult();
// 
//     /**
//      * Checks whether the application was successfully registered on the service.
//      *
//      * @return {@code true} if the application was successfully registered on the service, otherwise false.
//      */
//     boolean isRegistered();
// 
//     /**
//      * Returns the registration ID or null if provider isn't registered.
//      *
//      * @return The registration ID or null if provider isn't registered.
//      */
//     @Nullable
//     String getRegistrationId();
// 
//     /**
//      * Returns the name of the provider. Must be unique for all providers.
//      *
//      * @return The name of the provider.
//      */
//     @NonNull
//     String getName();
// 
//     /**
//      * Returns the package of the application that contains API of the provider.
//      * Usually, this is a store application.
//      *
//      * @return The package of the application that contains API of the provider.
//      */
//     @Nullable
//     String getHostAppPackage();
// 
//     /**
//      * Returns the {@link NotificationMaker} object associated with provider.
//      *
//      * @return The {@link NotificationMaker} instance.
//      */
//     @NonNull
//     NotificationMaker getNotificationMaker();
// 
//     /**
//      * Verify that application manifest contains all needed permissions.
//      *
//      * @param checkManifestHandler If not null an exception isn't thrown.
//      * @throws java.lang.IllegalStateException If not all required permissions and components have been
//      *                                         described in the AndroidManifest.xml file.
//      */
//     void checkManifest(@Nullable CheckManifestHandler checkManifestHandler);
// 
//     /**
//      * Callback method, that called when the application state change, like update to new version,
//      * or system state changed, like update firmware to a newer version.
//      * <p/>
//      * If this method is called, your registration becomes invalid
//      * and you have to reset all saved registration data.
//      */
//     void onRegistrationInvalid();
// 
//     /**
//      * Callback method for notify that the provider became unavailable.
//      * In this method you have to reset all saved registration data.
//      */
//     void onUnavailable();
// }


// Path: opfpush/src/test/java/org/onepf/opfpush/testutil/Util.java
import org.onepf.opfpush.mock.MockNamePushProvider;
import org.onepf.opfpush.pushprovider.PushProvider;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Random;

package org.onepf.opfpush.testutil;



/**
 * @author antonpp
 * @since 13.04.15
 */
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() {