PentahoCheckedChainedException extends Exception { @Override public synchronized void printStackTrace( final java.io.PrintWriter pw ) { super.printStackTrace( pw ); } PentahoCheckedChainedException();  PentahoCheckedChainedException( final String message );  PentahoCheckedChainedException( final String message, final Throwable reas );  PentahoCheckedChainedException( final Throwable reas ); Throwable getRootCause(); @Override synchronized void printStackTrace( final java.io.PrintWriter pw ); @Override synchronized void printStackTrace( final PrintStream ps );  }
@Test public void testPrintStackTrace() { ByteArrayOutputStream stream = new ByteArrayOutputStream(); PrintWriter writer = new PrintWriter( stream, true ); PrintStream pStream = new PrintStream( stream, true ); PentahoCheckedChainedException exception = new CheckedException( CAUSE ); exception.printStackTrace( writer ); assertNotEquals( "", stream.toString() ); exception.printStackTrace( pStream ); assertNotEquals( "", pStream.toString() ); }