// Path: conductor/src/main/java/com/bluelinelabs/conductor/changehandler/SimpleSwapChangeHandler.java
// public class SimpleSwapChangeHandler extends ControllerChangeHandler implements OnAttachStateChangeListener {
// 
//     private static final String KEY_REMOVES_FROM_ON_PUSH = "SimpleSwapChangeHandler.removesFromViewOnPush";
// 
//     private boolean removesFromViewOnPush;
// 
//     private boolean canceled;
// 
//     private ViewGroup container;
//     private ControllerChangeCompletedListener changeListener;
// 
//     public SimpleSwapChangeHandler() {
//         this(true);
//     }
// 
//     public SimpleSwapChangeHandler(boolean removesFromViewOnPush) {
//         this.removesFromViewOnPush = removesFromViewOnPush;
//     }
// 
//     @Override
//     public void saveToBundle(@NonNull Bundle bundle) {
//         super.saveToBundle(bundle);
//         bundle.putBoolean(KEY_REMOVES_FROM_ON_PUSH, removesFromViewOnPush);
//     }
// 
//     @Override
//     public void restoreFromBundle(@NonNull Bundle bundle) {
//         super.restoreFromBundle(bundle);
//         removesFromViewOnPush = bundle.getBoolean(KEY_REMOVES_FROM_ON_PUSH);
//     }
// 
//     @Override
//     public void onAbortPush(@NonNull ControllerChangeHandler newHandler, @Nullable Controller newTop) {
//         super.onAbortPush(newHandler, newTop);
// 
//         canceled = true;
//     }
// 
//     @Override
//     public void completeImmediately() {
//         if (changeListener != null) {
//             changeListener.onChangeCompleted();
//             changeListener = null;
// 
//             container.removeOnAttachStateChangeListener(this);
//             container = null;
//         }
//     }
// 
//     @Override
//     public void performChange(@NonNull ViewGroup container, @Nullable View from, @Nullable View to, boolean isPush, @NonNull ControllerChangeCompletedListener changeListener) {
//         if (!canceled) {
//             if (from != null && (!isPush || removesFromViewOnPush)) {
//                 container.removeView(from);
//             }
// 
//             if (to != null && to.getParent() == null) {
//                 container.addView(to);
//             }
//         }
// 
//         if (container.getWindowToken() != null) {
//             changeListener.onChangeCompleted();
//         } else {
//             this.changeListener = changeListener;
//             this.container = container;
//             container.addOnAttachStateChangeListener(this);
//         }
// 
//     }
// 
//     @Override
//     public boolean removesFromViewOnPush() {
//         return removesFromViewOnPush;
//     }
// 
//     @Override
//     public void onViewAttachedToWindow(@NonNull View v) {
//         v.removeOnAttachStateChangeListener(this);
// 
//         if (changeListener != null) {
//             changeListener.onChangeCompleted();
//             changeListener = null;
//             container = null;
//         }
//     }
// 
//     @Override
//     public void onViewDetachedFromWindow(@NonNull View v) { }
// 
//     @Override @NonNull
//     public ControllerChangeHandler copy() {
//         return new SimpleSwapChangeHandler(removesFromViewOnPush());
//     }
// 
//     @Override
//     public boolean isReusable() {
//         return true;
//     }
// }
// 
// Path: conductor/src/main/java/com/bluelinelabs/conductor/internal/ClassUtils.java
// public class ClassUtils {
// 
//     @Nullable @SuppressWarnings("unchecked")
//     public static <T> Class<? extends T> classForName(@NonNull String className, boolean allowEmptyName) {
//         if (allowEmptyName && TextUtils.isEmpty(className)) {
//             return null;
//         }
// 
//         try {
//             return (Class<? extends T>)Class.forName(className);
//         } catch (Exception e) {
//             throw new RuntimeException("An exception occurred while finding class for name " + className + ". " + e.getMessage());
//         }
//     }
// 
//     @Nullable @SuppressWarnings("unchecked")
//     public static <T> T newInstance(@NonNull String className) {
//         try {
//             Class<? extends T> cls = classForName(className, true);
//             return cls != null ? cls.newInstance() : null;
//         } catch (Exception e) {
//             throw new RuntimeException("An exception occurred while creating a new instance of " + className + ". " + e.getMessage());
//         }
//     }
// 
// }


import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.bluelinelabs.conductor.changehandler.SimpleSwapChangeHandler;
import com.bluelinelabs.conductor.internal.ClassUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
     * prior to use.
     */
    public boolean isReusable() {
        return false;
    }

    @NonNull
    final Bundle toBundle() {
        Bundle bundle = new Bundle();
        bundle.putString(KEY_CLASS_NAME, getClass().getName());

        Bundle savedState = new Bundle();
        saveToBundle(savedState);
        bundle.putBundle(KEY_SAVED_STATE, savedState);

        return bundle;
    }

    private void ensureDefaultConstructor() {
        try {
            getClass().getConstructor();
        } catch (Exception e) {
            throw new RuntimeException(getClass() + " does not have a default constructor.");
        }
    }

    @Nullable
    public static ControllerChangeHandler fromBundle(@Nullable Bundle bundle) {
        if (bundle != null) {
            String className = bundle.getString(KEY_CLASS_NAME);
// Path: conductor/src/main/java/com/bluelinelabs/conductor/changehandler/SimpleSwapChangeHandler.java
// public class SimpleSwapChangeHandler extends ControllerChangeHandler implements OnAttachStateChangeListener {
// 
//     private static final String KEY_REMOVES_FROM_ON_PUSH = "SimpleSwapChangeHandler.removesFromViewOnPush";
// 
//     private boolean removesFromViewOnPush;
// 
//     private boolean canceled;
// 
//     private ViewGroup container;
//     private ControllerChangeCompletedListener changeListener;
// 
//     public SimpleSwapChangeHandler() {
//         this(true);
//     }
// 
//     public SimpleSwapChangeHandler(boolean removesFromViewOnPush) {
//         this.removesFromViewOnPush = removesFromViewOnPush;
//     }
// 
//     @Override
//     public void saveToBundle(@NonNull Bundle bundle) {
//         super.saveToBundle(bundle);
//         bundle.putBoolean(KEY_REMOVES_FROM_ON_PUSH, removesFromViewOnPush);
//     }
// 
//     @Override
//     public void restoreFromBundle(@NonNull Bundle bundle) {
//         super.restoreFromBundle(bundle);
//         removesFromViewOnPush = bundle.getBoolean(KEY_REMOVES_FROM_ON_PUSH);
//     }
// 
//     @Override
//     public void onAbortPush(@NonNull ControllerChangeHandler newHandler, @Nullable Controller newTop) {
//         super.onAbortPush(newHandler, newTop);
// 
//         canceled = true;
//     }
// 
//     @Override
//     public void completeImmediately() {
//         if (changeListener != null) {
//             changeListener.onChangeCompleted();
//             changeListener = null;
// 
//             container.removeOnAttachStateChangeListener(this);
//             container = null;
//         }
//     }
// 
//     @Override
//     public void performChange(@NonNull ViewGroup container, @Nullable View from, @Nullable View to, boolean isPush, @NonNull ControllerChangeCompletedListener changeListener) {
//         if (!canceled) {
//             if (from != null && (!isPush || removesFromViewOnPush)) {
//                 container.removeView(from);
//             }
// 
//             if (to != null && to.getParent() == null) {
//                 container.addView(to);
//             }
//         }
// 
//         if (container.getWindowToken() != null) {
//             changeListener.onChangeCompleted();
//         } else {
//             this.changeListener = changeListener;
//             this.container = container;
//             container.addOnAttachStateChangeListener(this);
//         }
// 
//     }
// 
//     @Override
//     public boolean removesFromViewOnPush() {
//         return removesFromViewOnPush;
//     }
// 
//     @Override
//     public void onViewAttachedToWindow(@NonNull View v) {
//         v.removeOnAttachStateChangeListener(this);
// 
//         if (changeListener != null) {
//             changeListener.onChangeCompleted();
//             changeListener = null;
//             container = null;
//         }
//     }
// 
//     @Override
//     public void onViewDetachedFromWindow(@NonNull View v) { }
// 
//     @Override @NonNull
//     public ControllerChangeHandler copy() {
//         return new SimpleSwapChangeHandler(removesFromViewOnPush());
//     }
// 
//     @Override
//     public boolean isReusable() {
//         return true;
//     }
// }
// 
// Path: conductor/src/main/java/com/bluelinelabs/conductor/internal/ClassUtils.java
// public class ClassUtils {
// 
//     @Nullable @SuppressWarnings("unchecked")
//     public static <T> Class<? extends T> classForName(@NonNull String className, boolean allowEmptyName) {
//         if (allowEmptyName && TextUtils.isEmpty(className)) {
//             return null;
//         }
// 
//         try {
//             return (Class<? extends T>)Class.forName(className);
//         } catch (Exception e) {
//             throw new RuntimeException("An exception occurred while finding class for name " + className + ". " + e.getMessage());
//         }
//     }
// 
//     @Nullable @SuppressWarnings("unchecked")
//     public static <T> T newInstance(@NonNull String className) {
//         try {
//             Class<? extends T> cls = classForName(className, true);
//             return cls != null ? cls.newInstance() : null;
//         } catch (Exception e) {
//             throw new RuntimeException("An exception occurred while creating a new instance of " + className + ". " + e.getMessage());
//         }
//     }
// 
// }


// Path: conductor/src/main/java/com/bluelinelabs/conductor/ControllerChangeHandler.java
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.bluelinelabs.conductor.changehandler.SimpleSwapChangeHandler;
import com.bluelinelabs.conductor.internal.ClassUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

     * prior to use.
     */
    public boolean isReusable() {
        return false;
    }

    @NonNull
    final Bundle toBundle() {
        Bundle bundle = new Bundle();
        bundle.putString(KEY_CLASS_NAME, getClass().getName());

        Bundle savedState = new Bundle();
        saveToBundle(savedState);
        bundle.putBundle(KEY_SAVED_STATE, savedState);

        return bundle;
    }

    private void ensureDefaultConstructor() {
        try {
            getClass().getConstructor();
        } catch (Exception e) {
            throw new RuntimeException(getClass() + " does not have a default constructor.");
        }
    }

    @Nullable
    public static ControllerChangeHandler fromBundle(@Nullable Bundle bundle) {
        if (bundle != null) {
            String className = bundle.getString(KEY_CLASS_NAME);
            ControllerChangeHandler changeHandler = ClassUtils.newInstance(className);