// Path: lib-core/src/main/java/xdroid/core/ObjectUtils.java
// public static <T> T notNull(T object) {
//     if (object == null) {
//         throw new NullPointerException();
//     }
// 
//     return object;
// }


import android.app.Activity;
import java.util.ArrayList;
import java.util.Collection;
import static xdroid.core.ObjectUtils.notNull;
package xdroid.app;




/**
 * @author Oleksii Kropachov (o.kropachov@shamanland.com)
 */
public class ActivityListeners {
    private Collection<OnBackPressedListener> mBackPressed;
    private Collection<OnFinishListener> mFinish;

    public void add(OnBackPressedListener listener) {
        if (mBackPressed == null) {
            mBackPressed = new ArrayList<>(2);
        }

        mBackPressed.add(notNull(listener));
    }

    public void add(OnFinishListener listener) {
        if (mFinish == null) {
            mFinish = new ArrayList<>(2);
        }

// Path: lib-core/src/main/java/xdroid/core/ObjectUtils.java
// public static <T> T notNull(T object) {
//     if (object == null) {
//         throw new NullPointerException();
//     }
// 
//     return object;
// }


// Path: lib-app/src/main/java/xdroid/app/ActivityListeners.java
import android.app.Activity;
import java.util.ArrayList;
import java.util.Collection;
import static xdroid.core.ObjectUtils.notNull;

package xdroid.app;




/**
 * @author Oleksii Kropachov (o.kropachov@shamanland.com)
 */
public class ActivityListeners {
    private Collection<OnBackPressedListener> mBackPressed;
    private Collection<OnFinishListener> mFinish;

    public void add(OnBackPressedListener listener) {
        if (mBackPressed == null) {
            mBackPressed = new ArrayList<>(2);
        }

        mBackPressed.add(notNull(listener));
    }

    public void add(OnFinishListener listener) {
        if (mFinish == null) {
            mFinish = new ArrayList<>(2);
        }

        mFinish.add(notNull(listener));