WXCirclePageAdapter extends PagerAdapter { public void replacePageView(View oldView, View newView) { if (WXEnvironment.isApkDebugable()) { WXLogUtils.d("onPageSelected >>>> replacePageView"); } if (views == null) { views = new ArrayList<>(); } int index = views.indexOf(oldView); views.remove(index); views.add(index, newView); 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 testReplacePageView() throws Exception { testAddPageView(); View relace = new View(child.getContext()); adapter.replacePageView(child,relace); assertEquals(adapter.getRealCount(),3); }