### Question:
PrintUtilImpl implements PrintUtil { public void copyProviderDataToBuilder(TemplateBuilder builder, TemplateBuilderDataProvider templateBuilderDataProvider) { PageSize size = templateBuilderDataProvider.getPageSize(); if (templateBuilderDataProvider.isLandscape()) { builder.setPageHeight(size.getWidth()); builder.setPageWidth(size.getHeight()); } else { builder.setPageHeight(size.getHeight()); builder.setPageWidth(size.getWidth()); } builder.setTitleText(templateBuilderDataProvider.getTitle()); builder.setWithArrow(templateBuilderDataProvider.isWithArrow()); builder.setWithScaleBar(templateBuilderDataProvider.isWithScaleBar()); builder.setRasterDpi(templateBuilderDataProvider.getRasterDpi()); builder.setDpi(templateBuilderDataProvider.getDpi()); }  void copyProviderDataToBuilder(TemplateBuilder builder,
										  TemplateBuilderDataProvider templateBuilderDataProvider); @Override String getPrintEncodeUrl(String documentId, String fileName, String userToken,
									PrintConfiguration.PostPrintAction postPrintAction); @Override String toString(PrintConfiguration.PostPrintAction postPrintAction); @Override PrintTemplateInfo createPrintTemplateInfo(MapPresenter mapPresenter,
													 String applicationId,
													 TemplateBuilder builder,
													 TemplateBuilderDataProvider templateBuilderDataProvider);  }### Answer:
@Test public void copyProviderDataToBuilderTest() { printUtil.copyProviderDataToBuilder(builderMock, dataProviderMock); verify(dataProviderMock).getTitle(); verify(builderMock).setTitleText(viewData.getTitle()); verify(dataProviderMock).isWithArrow(); verify(builderMock).setWithArrow(viewData.isWithArrow()); verify(dataProviderMock).isWithScaleBar(); verify(builderMock).setWithScaleBar(viewData.isWithScaleBar()); verify(dataProviderMock).getDpi(); verify(builderMock).setDpi(viewData.getDpi()); verify(dataProviderMock).getRasterDpi(); verify(builderMock).setRasterDpi(viewData.getRasterDpi()); assertDimensions(); }
@Test public void landscapeTest() { viewData.setLandscape(true); stubDataProvider(); printUtil.copyProviderDataToBuilder(builderMock, dataProviderMock); assertDimensions(); }
@Test public void noLandscapeTest() { viewData.setLandscape(false); stubDataProvider(); printUtil.copyProviderDataToBuilder(builderMock, dataProviderMock); assertDimensions(); }
@Test public void noLandscapeOtherPageSizeTest() { viewData.setLandscape(false); viewData.setPageSize(PageSize.A4); stubDataProvider(); printUtil.copyProviderDataToBuilder(builderMock, dataProviderMock); assertDimensions(); }