// Path: opfpush/src/main/java/org/onepf/opfpush/model/Operation.java
// public enum Operation {
//     REGISTER,
//     UNREGISTER
// }


import android.support.annotation.NonNull;
import org.onepf.opfutils.OPFLog;
import org.onepf.opfpush.model.Operation;
import java.util.HashMap;
import java.util.Map;
import static org.onepf.opfpush.model.Operation.UNREGISTER;
    public boolean hasTries(@NonNull final String providerName,
                            @NonNull final Operation operation) {
        OPFLog.logMethod(providerName, operation);
        checkOperation(operation);
        if (backoffMap.containsKey(providerName)) {
            OPFLog.d("Backoff map contains key for provider " + providerName);
            return backoffMap.get(providerName).hasTries();
        }

        final Backoff newUnregisterBackoff = createBackoff();
        backoffMap.put(providerName, newUnregisterBackoff);
        return newUnregisterBackoff.hasTries();
    }

    @Override
    public long getTryDelay(@NonNull final String providerName,
                            @NonNull final Operation operation) {
        OPFLog.logMethod(providerName, operation);
        checkOperation(operation);
        if (backoffMap.containsKey(providerName)) {
            OPFLog.d("Backoff map contains key for provider " + providerName);
            return backoffMap.get(providerName).getTryDelay();
        }

        final Backoff newUnregisterBackoff = createBackoff();
        backoffMap.put(providerName, newUnregisterBackoff);
        return newUnregisterBackoff.getTryDelay();
    }

    @Override
// Path: opfpush/src/main/java/org/onepf/opfpush/model/Operation.java
// public enum Operation {
//     REGISTER,
//     UNREGISTER
// }


// Path: opfpush/src/main/java/org/onepf/opfpush/backoff/UnregisterBackoffAdapter.java
import android.support.annotation.NonNull;
import org.onepf.opfutils.OPFLog;
import org.onepf.opfpush.model.Operation;
import java.util.HashMap;
import java.util.Map;
import static org.onepf.opfpush.model.Operation.UNREGISTER;

    public boolean hasTries(@NonNull final String providerName,
                            @NonNull final Operation operation) {
        OPFLog.logMethod(providerName, operation);
        checkOperation(operation);
        if (backoffMap.containsKey(providerName)) {
            OPFLog.d("Backoff map contains key for provider " + providerName);
            return backoffMap.get(providerName).hasTries();
        }

        final Backoff newUnregisterBackoff = createBackoff();
        backoffMap.put(providerName, newUnregisterBackoff);
        return newUnregisterBackoff.hasTries();
    }

    @Override
    public long getTryDelay(@NonNull final String providerName,
                            @NonNull final Operation operation) {
        OPFLog.logMethod(providerName, operation);
        checkOperation(operation);
        if (backoffMap.containsKey(providerName)) {
            OPFLog.d("Backoff map contains key for provider " + providerName);
            return backoffMap.get(providerName).getTryDelay();
        }

        final Backoff newUnregisterBackoff = createBackoff();
        backoffMap.put(providerName, newUnregisterBackoff);
        return newUnregisterBackoff.getTryDelay();
    }

    @Override
    public void reset(@NonNull final String providerName, @NonNull final Operation operation) {