@Test public void testPaginate() throws Exception {

  PageableHTMLOutput output = mock( PageableHTMLOutput.class, CALLS_REAL_METHODS );
  PageableReportProcessor processor = mock( PageableReportProcessor.class );
  doNothing().when( output ).reinitOutputTarget();
  doReturn( true ).when( processor ).isPaginated();
  MasterReport report = mock( MasterReport.class );
  AllItemsHtmlPrinter printer = mock( AllItemsHtmlPrinter.class );
  doNothing().when( printer ).setContentWriter( null, null );
  doNothing().when( printer ).setDataWriter( null, null );
  output.setReportProcessor( processor );
  output.setPrinter( printer );
  Assert.assertEquals( 0, output.paginate( report, 0 ) );
  doReturn( false ).when( processor ).isPaginated();
  output.setReportProcessor( processor );
  Assert.assertEquals( 0, output.paginate( report, 0 ) );
}