PopUpCoachMarkPresenter { protected void detectAndCreateShimOutViews(@Nullable List<InfoForViewToMask> infoForViewToMaskList) { if (infoForViewToMaskList == null) { return; } for (InfoForViewToMask infoForViewToMask : infoForViewToMaskList) { mPresentation.createViewToBeMaskedOut( infoForViewToMask.getViewToMaskStartPosition().x, infoForViewToMask.getViewToMaskStartPosition().y, infoForViewToMask.getViewToMaskHeight(), infoForViewToMask.getViewToMaskWidth()); } } PopUpCoachMarkPresenter(final IStringResourceProvider stringResourceProvider,
                                   final IDimensionResourceProvider dimensionResourceProvider,
                                   final ITypeFaceProvider typeFaceProvider,
                                   final IScreenInfoProvider screenInfoProvider); void onCreate(CoachMarkBuilder coachMarkBuilder); void onCreateView(IPopUpCoachMarkPresentation popUpCoachMarkPresentation); void onViewCreated(); void onDestroyView(); void onDestroy(); void onOkButtonClicked(); void onShimClicked();  }
@Test public void detectAndCreateShimOutViewsNullShimOutViewListTest() { mPopUpCoachMarkPresenter.detectAndCreateShimOutViews(null); Mockito.verify(mPopUpCoachMarkPresentation, Mockito.times(0)). createViewToBeMaskedOut(Matchers.anyInt(), Matchers.anyInt(), Matchers.anyInt(), Matchers.anyInt()); Mockito.verifyNoMoreInteractions(mPopUpCoachMarkPresentation); }
@Test public void detectAndCreateShimOutViewsTest() { int listSize = 2; List<InfoForViewToMask> infoForViewToMaskList = new ArrayList<>(listSize); InfoForViewToMask infoForViewToMask = InfoForViewToMask.create(new Point(0, 0), 100, 100).build(); for (int i = 0; i < listSize; i++) { infoForViewToMaskList.add(infoForViewToMask); } mPopUpCoachMarkPresenter.detectAndCreateShimOutViews(infoForViewToMaskList); Mockito.verify(mPopUpCoachMarkPresentation, Mockito.times(listSize)). createViewToBeMaskedOut(Matchers.anyInt(), Matchers.anyInt(), Matchers.anyInt(), Matchers.anyInt()); Mockito.verifyNoMoreInteractions(mPopUpCoachMarkPresentation); }