// 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/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/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 android.os.Parcel;
import com.zhuinden.simplestack.helpers.HasParentServices;
import com.zhuinden.simplestack.helpers.ServiceProvider;
import com.zhuinden.simplestack.helpers.TestKeyWithScope;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import javax.annotation.Nonnull;
import static org.assertj.core.api.Assertions.assertThat;
        TestKeyWithExplicitParent boop = new TestKeyWithExplicitParent("scope2") {
            @Nonnull
            @Override
            public List<String> getParentScopes() {
                return History.of("parent1", "parent2");
            }

            @Override
            void bindParentServices(ServiceBinder serviceBinder) {
                if("parent1".equals(serviceBinder.getScopeTag())) {
                    serviceBinder.addService("serviceP1", serviceP1);
                    serviceBinder.addService("serviceShared1P1", serviceShared1P1);
                    serviceBinder.addService("serviceShared2P1", serviceShared2P1);
                    serviceBinder.addService("serviceShared3P1", serviceShared3P1);
                    serviceBinder.addService("serviceShared0123P1P2P3", serviceShared0123P1P2P3);
                }
                if("parent2".equals(serviceBinder.getScopeTag())) {
                    serviceBinder.addService("serviceP2", serviceP2);
                    serviceBinder.addService("serviceShared1P2", serviceShared1P2);
                    serviceBinder.addService("serviceShared2P2", serviceShared2P2);
                    serviceBinder.addService("serviceShared3P2", serviceShared3P2);
                    serviceBinder.addService("serviceShared0123P1P2P3", serviceShared0123P1P2P3);
                }
            }

            @Override
            void bindOwnServices(ServiceBinder serviceBinder) {
                serviceBinder.addService("service2", service2);

                serviceBinder.addService("serviceShared12", serviceShared12);
// 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/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/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/ScopingRegisteredCallbackTest.java
import android.os.Parcel;
import com.zhuinden.simplestack.helpers.HasParentServices;
import com.zhuinden.simplestack.helpers.ServiceProvider;
import com.zhuinden.simplestack.helpers.TestKeyWithScope;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import javax.annotation.Nonnull;
import static org.assertj.core.api.Assertions.assertThat;

        TestKeyWithExplicitParent boop = new TestKeyWithExplicitParent("scope2") {
            @Nonnull
            @Override
            public List<String> getParentScopes() {
                return History.of("parent1", "parent2");
            }

            @Override
            void bindParentServices(ServiceBinder serviceBinder) {
                if("parent1".equals(serviceBinder.getScopeTag())) {
                    serviceBinder.addService("serviceP1", serviceP1);
                    serviceBinder.addService("serviceShared1P1", serviceShared1P1);
                    serviceBinder.addService("serviceShared2P1", serviceShared2P1);
                    serviceBinder.addService("serviceShared3P1", serviceShared3P1);
                    serviceBinder.addService("serviceShared0123P1P2P3", serviceShared0123P1P2P3);
                }
                if("parent2".equals(serviceBinder.getScopeTag())) {
                    serviceBinder.addService("serviceP2", serviceP2);
                    serviceBinder.addService("serviceShared1P2", serviceShared1P2);
                    serviceBinder.addService("serviceShared2P2", serviceShared2P2);
                    serviceBinder.addService("serviceShared3P2", serviceShared3P2);
                    serviceBinder.addService("serviceShared0123P1P2P3", serviceShared0123P1P2P3);
                }
            }

            @Override
            void bindOwnServices(ServiceBinder serviceBinder) {
                serviceBinder.addService("service2", service2);

                serviceBinder.addService("serviceShared12", serviceShared12);
                serviceBinder.addService("serviceShared23", serviceShared23);