WXCirclePageAdapter extends PagerAdapter { public void addPageView(View view) { if (WXEnvironment.isApkDebugable()) { WXLogUtils.d("onPageSelected >>>> addPageView"); } if (views == null) { views = new ArrayList<>(); } views.add(view); this.realCount = views.size(); } WXCirclePageAdapter(List<View> views);  WXCirclePageAdapter(); void addPageView(View view); void removePageView(View view); void replacePageView(View oldView, View newView); @Override int getCount(); int getRealCount(); @Override Object instantiateItem(ViewGroup container, int position); @Override void destroyItem(ViewGroup container, int position, Object object); @Override boolean isViewFromObject(View view, Object object); @Override int getItemPosition(Object object); List<View> getViews();  }
@Test public void testAddPageView() throws Exception { Activity activity = Robolectric.setupActivity(TestActivity.class); child = new View(activity); adapter.addPageView(child); child = new View(activity); adapter.addPageView(child); child = new View(activity); adapter.addPageView(child); assertEquals(adapter.getRealCount(),3); }