// Path: simple-stack/src/test/java/com/zhuinden/simplestack/helpers/HasParentServices.java
// public interface HasParentServices
//         extends ScopeKey.Child {
//     void bindServices(ServiceBinder serviceBinder);
// }
// 
// Path: simple-stack/src/test/java/com/zhuinden/simplestack/helpers/HasServices.java
// public interface HasServices
//         extends ScopeKey {
//     void bindServices(ServiceBinder serviceBinder);
// }
// 
// Path: simple-stack/src/test/java/com/zhuinden/simplestack/helpers/ServiceProvider.java
// public class ServiceProvider
//         implements ScopedServices {
//     @Override
//     public void bindServices(@Nonnull ServiceBinder serviceBinder) {
//         Object key = serviceBinder.getKey();
//         if(key instanceof HasServices) {
//             ((HasServices) key).bindServices(serviceBinder);
//             return;
//         }
//         if(key instanceof HasParentServices) {
//             ((HasParentServices) key).bindServices(serviceBinder);
//             //noinspection UnnecessaryReturnStatement
//             return;
//         }
//     }
// }
// 
// Path: simple-stack/src/test/java/com/zhuinden/simplestack/helpers/TestKey.java
// public class TestKey
//         implements Parcelable {
//     public final String name;
// 
//     public TestKey(String name) {
//         this.name = name;
//     }
// 
//     protected TestKey(Parcel in) {
//         name = in.readString();
//     }
// 
//     public static final Creator<TestKey> CREATOR = new Creator<TestKey>() {
//         @Override
//         public TestKey createFromParcel(Parcel in) {
//             return new TestKey(in);
//         }
// 
//         @Override
//         public TestKey[] newArray(int size) {
//             return new TestKey[size];
//         }
//     };
// 
//     @Override
//     public boolean equals(Object o) {
//         if(this == o) {
//             return true;
//         }
//         if(o == null || getClass() != o.getClass()) {
//             return false;
//         }
//         TestKey key = (TestKey) o;
//         return name.equals(key.name);
//     }
// 
//     @Override
//     public int hashCode() {
//         return name.hashCode();
//     }
// 
//     @Override
//     public String toString() {
//         return String.format("%s{%h}", name, this);
//     }
// 
//     @Override
//     public int describeContents() {
//         return 0;
//     }
// 
//     @Override
//     public void writeToParcel(Parcel dest, int flags) {
//         dest.writeString(name);
//     }
// }
// 
// Path: simple-stack/src/test/java/com/zhuinden/simplestack/helpers/TestKeyWithScope.java
// public abstract class TestKeyWithScope
//         extends TestKey
//         implements HasServices {
//     public TestKeyWithScope(String name) {
//         super(name);
//     }
// 
//     protected TestKeyWithScope(Parcel in) {
//         super(in);
//     }
// 
//     @Nonnull
//     @Override
//     public String getScopeTag() {
//         return name;
//     }
// }


import java.util.concurrent.atomic.AtomicReference;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import static org.assertj.core.api.Assertions.assertThat;
import android.os.Parcel;
import com.zhuinden.simplestack.helpers.HasParentServices;
import com.zhuinden.simplestack.helpers.HasServices;
import com.zhuinden.simplestack.helpers.ServiceProvider;
import com.zhuinden.simplestack.helpers.TestKey;
import com.zhuinden.simplestack.helpers.TestKeyWithScope;
import com.zhuinden.statebundle.StateBundle;
import org.junit.Assert;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

            @Override
            public void onServiceInactive() {
                events.add(Pair.of((Object) this, ServiceEvent.INACTIVE));
            }

            @Override
            public String toString() {
                return "MyService{" +
                        "id=" + id +
                        '}';
            }

            @Override
            public void onServiceRegistered() {
                events.add(Pair.of((Object) this, ServiceEvent.CREATE));
            }

            @Override
            public void onServiceUnregistered() {
                events.add(Pair.of((Object) this, ServiceEvent.DESTROY));
            }
        }


        final MyService globalService = new MyService(0);
        final MyService explicitParentService = new MyService(1);
        final MyService implicitParentService = new MyService(2);
        final MyService currentScopeService = new MyService(3);

// Path: simple-stack/src/test/java/com/zhuinden/simplestack/helpers/HasParentServices.java
// public interface HasParentServices
//         extends ScopeKey.Child {
//     void bindServices(ServiceBinder serviceBinder);
// }
// 
// Path: simple-stack/src/test/java/com/zhuinden/simplestack/helpers/HasServices.java
// public interface HasServices
//         extends ScopeKey {
//     void bindServices(ServiceBinder serviceBinder);
// }
// 
// Path: simple-stack/src/test/java/com/zhuinden/simplestack/helpers/ServiceProvider.java
// public class ServiceProvider
//         implements ScopedServices {
//     @Override
//     public void bindServices(@Nonnull ServiceBinder serviceBinder) {
//         Object key = serviceBinder.getKey();
//         if(key instanceof HasServices) {
//             ((HasServices) key).bindServices(serviceBinder);
//             return;
//         }
//         if(key instanceof HasParentServices) {
//             ((HasParentServices) key).bindServices(serviceBinder);
//             //noinspection UnnecessaryReturnStatement
//             return;
//         }
//     }
// }
// 
// Path: simple-stack/src/test/java/com/zhuinden/simplestack/helpers/TestKey.java
// public class TestKey
//         implements Parcelable {
//     public final String name;
// 
//     public TestKey(String name) {
//         this.name = name;
//     }
// 
//     protected TestKey(Parcel in) {
//         name = in.readString();
//     }
// 
//     public static final Creator<TestKey> CREATOR = new Creator<TestKey>() {
//         @Override
//         public TestKey createFromParcel(Parcel in) {
//             return new TestKey(in);
//         }
// 
//         @Override
//         public TestKey[] newArray(int size) {
//             return new TestKey[size];
//         }
//     };
// 
//     @Override
//     public boolean equals(Object o) {
//         if(this == o) {
//             return true;
//         }
//         if(o == null || getClass() != o.getClass()) {
//             return false;
//         }
//         TestKey key = (TestKey) o;
//         return name.equals(key.name);
//     }
// 
//     @Override
//     public int hashCode() {
//         return name.hashCode();
//     }
// 
//     @Override
//     public String toString() {
//         return String.format("%s{%h}", name, this);
//     }
// 
//     @Override
//     public int describeContents() {
//         return 0;
//     }
// 
//     @Override
//     public void writeToParcel(Parcel dest, int flags) {
//         dest.writeString(name);
//     }
// }
// 
// Path: simple-stack/src/test/java/com/zhuinden/simplestack/helpers/TestKeyWithScope.java
// public abstract class TestKeyWithScope
//         extends TestKey
//         implements HasServices {
//     public TestKeyWithScope(String name) {
//         super(name);
//     }
// 
//     protected TestKeyWithScope(Parcel in) {
//         super(in);
//     }
// 
//     @Nonnull
//     @Override
//     public String getScopeTag() {
//         return name;
//     }
// }


// Path: simple-stack/src/test/java/com/zhuinden/simplestack/ScopingGlobalScopeTest.java
import java.util.concurrent.atomic.AtomicReference;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import static org.assertj.core.api.Assertions.assertThat;
import android.os.Parcel;
import com.zhuinden.simplestack.helpers.HasParentServices;
import com.zhuinden.simplestack.helpers.HasServices;
import com.zhuinden.simplestack.helpers.ServiceProvider;
import com.zhuinden.simplestack.helpers.TestKey;
import com.zhuinden.simplestack.helpers.TestKeyWithScope;
import com.zhuinden.statebundle.StateBundle;
import org.junit.Assert;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;


            @Override
            public void onServiceInactive() {
                events.add(Pair.of((Object) this, ServiceEvent.INACTIVE));
            }

            @Override
            public String toString() {
                return "MyService{" +
                        "id=" + id +
                        '}';
            }

            @Override
            public void onServiceRegistered() {
                events.add(Pair.of((Object) this, ServiceEvent.CREATE));
            }

            @Override
            public void onServiceUnregistered() {
                events.add(Pair.of((Object) this, ServiceEvent.DESTROY));
            }
        }


        final MyService globalService = new MyService(0);
        final MyService explicitParentService = new MyService(1);
        final MyService implicitParentService = new MyService(2);
        final MyService currentScopeService = new MyService(3);

        abstract class TestKeyWithExplicitParent extends TestKeyWithScope implements HasParentServices {