PopUpCoachMarkPresenter { protected boolean checkIfRightPossible(Point viewCenterPoint, CoachMarkPixelInfo coachMarkDimenInPixel) { int centerX = viewCenterPoint.x; return (coachMarkDimenInPixel.getPopUpWidthInPixelsWithOffset()) <= (coachMarkDimenInPixel.getScreenWidthInPixels() - centerX) && ((coachMarkDimenInPixel.getPopUpHeightInPixelsWithOffset() + coachMarkDimenInPixel.getMarginRectInPixels().top + coachMarkDimenInPixel.getActionBarHeightPixels() + coachMarkDimenInPixel.getFooterHeightPixels() + coachMarkDimenInPixel.getMarginRectInPixels().bottom) <= coachMarkDimenInPixel.getScreenHeightInPixels()); } 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 checkIfRightPossibleTest(){ MockedPoint point = new MockedPoint(600, 300); assertEquals(false, mPopUpCoachMarkPresenter.checkIfRightPossible(point, mCoachMarkPixelInfo)); point = new MockedPoint(400, 200); assertEquals(true, mPopUpCoachMarkPresenter.checkIfRightPossible(point, mCoachMarkPixelInfo)); point = new MockedPoint(100, 200); assertEquals(true, mPopUpCoachMarkPresenter.checkIfRightPossible(point, mCoachMarkPixelInfo)); point = new MockedPoint(700, 700); assertEquals(false, mPopUpCoachMarkPresenter.checkIfRightPossible(point, mCoachMarkPixelInfo)); }