PopUpCoachMarkPresenter { protected int getActualTopMargin(int centerTopY, CoachMarkPixelInfo coachMarkDimenInPixel) { if (centerTopY + coachMarkDimenInPixel.getPopUpHeightInPixels() + coachMarkDimenInPixel.getWidthHeightOffsetForCoachMarkPopUp() + coachMarkDimenInPixel.getMarginRectInPixels().top + coachMarkDimenInPixel.getMarginRectInPixels().bottom > coachMarkDimenInPixel.getScreenHeightInPixels()) { return coachMarkDimenInPixel.getScreenHeightInPixels() - coachMarkDimenInPixel.getPopUpHeightInPixels() + coachMarkDimenInPixel.getWidthHeightOffsetForCoachMarkPopUp() + coachMarkDimenInPixel.getMarginRectInPixels().top + coachMarkDimenInPixel.getMarginRectInPixels().bottom; } return centerTopY + coachMarkDimenInPixel.getMarginRectInPixels().top; } 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 getActualTopMarginTest(){ assertEquals(100, mPopUpCoachMarkPresenter.getActualTopMargin(100, mCoachMarkPixelInfo)); assertEquals(900, mPopUpCoachMarkPresenter.getActualTopMargin(900, mCoachMarkPixelInfo)); }