GalleryAdapter extends PagerAdapter { @Override public boolean isViewFromObject(View view, Object object) { return view == object; } GalleryAdapter(Context context, SwipeToDismissTouchListener.Callback callback); @Override int getCount(); @Override boolean isViewFromObject(View view, Object object); @Override Object instantiateItem(ViewGroup container, int position); @Override void destroyItem(ViewGroup container, int position, Object object);  }
@Test public void testIsViewFromObject_withSameObject() { assertTrue(subject.isViewFromObject(view, view)); }
@Test public void testIsViewFromObject_withDifferentObject() { assertFalse(subject.isViewFromObject(view, entity)); }