// Path: phial-overlay/src/main/java/com/mindcoders/phial/Page.java
// public final class Page {
// 
//     /**
//      * Factory that is used to create views when page is selected
//      *
//      * @param <T> view to display
//      */
//     public interface PageViewFactory<T extends View & PageView> {
// 
//         /**
//          * @param context         android application context
//          * @param overlayCallback interface for communication with Phial
//          * @return view to display
//          */
//         T createPageView(Context context, OverlayCallback overlayCallback);
// 
//     }
// 
//     private final String id;
//     private final int iconResourceId;
//     private final CharSequence title;
//     private final PageViewFactory pageViewFactory;
//     private final Set<TargetScreen> targetScreens;
// 
//     /**
//      * @param id              unique pageId
//      * @param iconResourceId  page icon
//      * @param title           page title
//      * @param pageViewFactory factory that will create view when page is selected
//      */
//     public Page(
//             String id,
//             int iconResourceId,
//             CharSequence title,
//             PageViewFactory pageViewFactory
//     ) {
//         this(id, iconResourceId, title, pageViewFactory, Collections.<TargetScreen>emptySet());
//     }
// 
//     /**
//      * @param id              unique pageId
//      * @param iconResourceId  page icon
//      * @param title           page title
//      * @param pageViewFactory factory that will create view when page is selected
//      * @param targetScreens   screens to present this page on. Page will be present on all screens if this is empty.
//      */
//     public Page(
//             String id,
//             int iconResourceId,
//             CharSequence title,
//             PageViewFactory pageViewFactory,
//             Set<TargetScreen> targetScreens
//     ) {
//         this.id = id;
//         this.iconResourceId = iconResourceId;
//         this.title = title;
//         this.pageViewFactory = pageViewFactory;
//         this.targetScreens = Collections.unmodifiableSet(targetScreens);
//     }
// 
//     public String getId() {
//         return id;
//     }
// 
//     public int getIconResourceId() {
//         return iconResourceId;
//     }
// 
//     public CharSequence getTitle() {
//         return title;
//     }
// 
//     public PageViewFactory getPageViewFactory() {
//         return pageViewFactory;
//     }
// 
//     public Set<TargetScreen> getTargetScreens() {
//         return targetScreens;
//     }
// 
// }
// 
// Path: phial-overlay/src/main/java/com/mindcoders/phial/PageView.java
// public interface PageView {
// 
//     /**
//      * Called when device back button has been pressed
//      * @return true if the event was consumed; false otherwise.
//      */
//     boolean onBackPressed();
// 
// }
// 
// Path: phial-overlay/src/main/java/com/mindcoders/phial/internal/util/ObjectUtil.java
// public final class ObjectUtil {
//     private ObjectUtil() {
//         //to hide
//     }
// 
//     public static <T> boolean equals(T a, T b) {
//         return (a == b) || (a != null && a.equals(b));
//     }
// }


import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import com.google.common.collect.ImmutableList;
import com.mindcoders.phial.Page;
import com.mindcoders.phial.PageView;
import com.mindcoders.phial.R;
import com.mindcoders.phial.internal.util.ObjectUtil;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.android.controller.ActivityController;
import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.withSettings;
package com.mindcoders.phial.internal.overlay;






@RunWith(RobolectricTestRunner.class)
public class ExpandedViewTest {

    private ExpandedView view;

    private ActivityController<Activity> activityController;

    @Before
    public void setUp() throws Exception {
        activityController = Robolectric.buildActivity(Activity.class);
        activityController.create();
        view = new ExpandedView(activityController.get());
        activityController.get().setContentView(view);
    }

    @Test
    public void displayPages() throws Exception {
        View pageView1 = mock(View.class, withSettings().extraInterfaces(PageView.class));
        View pageView2 = mock(View.class, withSettings().extraInterfaces(PageView.class));

// Path: phial-overlay/src/main/java/com/mindcoders/phial/Page.java
// public final class Page {
// 
//     /**
//      * Factory that is used to create views when page is selected
//      *
//      * @param <T> view to display
//      */
//     public interface PageViewFactory<T extends View & PageView> {
// 
//         /**
//          * @param context         android application context
//          * @param overlayCallback interface for communication with Phial
//          * @return view to display
//          */
//         T createPageView(Context context, OverlayCallback overlayCallback);
// 
//     }
// 
//     private final String id;
//     private final int iconResourceId;
//     private final CharSequence title;
//     private final PageViewFactory pageViewFactory;
//     private final Set<TargetScreen> targetScreens;
// 
//     /**
//      * @param id              unique pageId
//      * @param iconResourceId  page icon
//      * @param title           page title
//      * @param pageViewFactory factory that will create view when page is selected
//      */
//     public Page(
//             String id,
//             int iconResourceId,
//             CharSequence title,
//             PageViewFactory pageViewFactory
//     ) {
//         this(id, iconResourceId, title, pageViewFactory, Collections.<TargetScreen>emptySet());
//     }
// 
//     /**
//      * @param id              unique pageId
//      * @param iconResourceId  page icon
//      * @param title           page title
//      * @param pageViewFactory factory that will create view when page is selected
//      * @param targetScreens   screens to present this page on. Page will be present on all screens if this is empty.
//      */
//     public Page(
//             String id,
//             int iconResourceId,
//             CharSequence title,
//             PageViewFactory pageViewFactory,
//             Set<TargetScreen> targetScreens
//     ) {
//         this.id = id;
//         this.iconResourceId = iconResourceId;
//         this.title = title;
//         this.pageViewFactory = pageViewFactory;
//         this.targetScreens = Collections.unmodifiableSet(targetScreens);
//     }
// 
//     public String getId() {
//         return id;
//     }
// 
//     public int getIconResourceId() {
//         return iconResourceId;
//     }
// 
//     public CharSequence getTitle() {
//         return title;
//     }
// 
//     public PageViewFactory getPageViewFactory() {
//         return pageViewFactory;
//     }
// 
//     public Set<TargetScreen> getTargetScreens() {
//         return targetScreens;
//     }
// 
// }
// 
// Path: phial-overlay/src/main/java/com/mindcoders/phial/PageView.java
// public interface PageView {
// 
//     /**
//      * Called when device back button has been pressed
//      * @return true if the event was consumed; false otherwise.
//      */
//     boolean onBackPressed();
// 
// }
// 
// Path: phial-overlay/src/main/java/com/mindcoders/phial/internal/util/ObjectUtil.java
// public final class ObjectUtil {
//     private ObjectUtil() {
//         //to hide
//     }
// 
//     public static <T> boolean equals(T a, T b) {
//         return (a == b) || (a != null && a.equals(b));
//     }
// }


// Path: phial-overlay/src/test/java/com/mindcoders/phial/internal/overlay/ExpandedViewTest.java
import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import com.google.common.collect.ImmutableList;
import com.mindcoders.phial.Page;
import com.mindcoders.phial.PageView;
import com.mindcoders.phial.R;
import com.mindcoders.phial.internal.util.ObjectUtil;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.android.controller.ActivityController;
import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.withSettings;

package com.mindcoders.phial.internal.overlay;






@RunWith(RobolectricTestRunner.class)
public class ExpandedViewTest {

    private ExpandedView view;

    private ActivityController<Activity> activityController;

    @Before
    public void setUp() throws Exception {
        activityController = Robolectric.buildActivity(Activity.class);
        activityController.create();
        view = new ExpandedView(activityController.get());
        activityController.get().setContentView(view);
    }

    @Test
    public void displayPages() throws Exception {
        View pageView1 = mock(View.class, withSettings().extraInterfaces(PageView.class));
        View pageView2 = mock(View.class, withSettings().extraInterfaces(PageView.class));

        List<Page> pages = ImmutableList.of(