### Question:
ReportExportMapper { public ReportExportOutput transform(final ExportOutputResource outputResource) { return new ReportExportOutput() { @Override public boolean isFinal() { return outputResource.isFinal(); } @Override public PageRange getPages() { return PageRange.parse(outputResource.getPages()); } @Override public InputStream getStream() throws IOException { return outputResource.getOutputResource().getStream(); } }; }  ReportExportOutput transform(final ExportOutputResource outputResource);  }### Answer:
@Test public void testTransform() throws Exception { when(mExportOutputResource.getPages()).thenReturn(TOTAL_PAGES); when(mExportOutputResource.isFinal()).thenReturn(Boolean.FALSE); when(mOutput.getStream()).thenReturn(mStream); when(mExportOutputResource.getOutputResource()).thenReturn(mOutput); ReportExportOutput export = mapper.transform(mExportOutputResource); assertThat(export.getPages(), is(PAGE_RANGE)); assertThat(export.isFinal(), is(Boolean.FALSE)); assertThat(export.getStream(), is(mStream)); }