PopUpCoachMarkPresenter { protected boolean checkIfTopPossible(Point viewCenterPoint, CoachMarkPixelInfo coachMarkDimenInPixel) { int centerY = viewCenterPoint.y; return (coachMarkDimenInPixel.getPopUpHeightInPixelsWithOffset() + coachMarkDimenInPixel.getMarginRectInPixels().top + coachMarkDimenInPixel.getMarginRectInPixels().bottom + coachMarkDimenInPixel.getActionBarHeightPixels()) <= centerY && ((coachMarkDimenInPixel.getWidthHeightOffsetForCoachMarkPopUp() + coachMarkDimenInPixel.getMarginRectInPixels().left + coachMarkDimenInPixel.getMarginRectInPixels().right) <= coachMarkDimenInPixel.getScreenWidthInPixels()); } 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 checkIfTopPossibleTest(){ MockedPoint point = new MockedPoint(600, 300); assertEquals(true, mPopUpCoachMarkPresenter.checkIfTopPossible(point, mCoachMarkPixelInfo)); point = new MockedPoint(400, 200); assertEquals(true, mPopUpCoachMarkPresenter.checkIfTopPossible(point, mCoachMarkPixelInfo)); point = new MockedPoint(100, 200); assertEquals(true, mPopUpCoachMarkPresenter.checkIfTopPossible(point, mCoachMarkPixelInfo)); point = new MockedPoint(700, 700); assertEquals(true, mPopUpCoachMarkPresenter.checkIfTopPossible(point, mCoachMarkPixelInfo)); point = new MockedPoint(400, 50); assertEquals(false, mPopUpCoachMarkPresenter.checkIfTopPossible(point, mCoachMarkPixelInfo)); point = new MockedPoint(0, 50); assertEquals(false, mPopUpCoachMarkPresenter.checkIfTopPossible(point, mCoachMarkPixelInfo)); }