StagingHandler { public boolean canSendHeaders() { if ( ( mode == StagingMode.THRU ) && ( getWrittenByteCount() > 0 ) ) { return false; } else { return true; } } StagingHandler( final OutputStream outputStream, final StagingMode stagingMode,
      final IPentahoSession userSession ); StagingMode getStagingMode(); boolean isFullyBuffered(); boolean canSendHeaders(); OutputStream getStagingOutputStream(); void complete(); void close(); int getWrittenByteCount();  }
@Test public void testCanSendHeaders() throws Exception { assertTrue( handler.canSendHeaders() ); OutputStream stream = handler.getStagingOutputStream(); assertEquals( ( (TrackingOutputStream) stream ).getWrappedStream().hashCode(), outputStream.hashCode() ); assertEquals( 0, handler.getWrittenByteCount() ); }