### Question:
GFFileHandler extends StreamHandler implements
    PostConstruct, PreDestroy, LogEventBroadcaster, LoggingRuntime { public synchronized void setLogStandardStreams(boolean logStandardStreams) { this.logStandardStreams = logStandardStreams; if (logStandardStreams) { logStandardStreams(); } else { System.setOut(oStdOutBackup); System.setErr(oStdErrBackup); } }  @Override void postConstruct(); @Override void preDestroy(); @Override File getCurrentLogFile(); void cleanUpHistoryLogFiles(); void rotate(); void log(); @Override void publish(LogRecord record); boolean addLogEventListener(LogEventListener listener); boolean removeLogEventListener(LogEventListener listener); @Override void informLogEventListeners(LogEvent logEvent); synchronized void setLogFile(String fileName); synchronized void setLogToFile(boolean logToFile); synchronized void setRotationOnDateChange(boolean rotationOnDateChange); synchronized void setMultiLineMode(boolean multiLineMode); synchronized void setFileHandlerFormatter(String fileHandlerFormatter); synchronized void setExcludeFields(String excludeFields); synchronized void setRotationLimitAttrValue(Integer rotationLimitAttrValue); synchronized void setRotationTimeLimitValue(Long rotationTimeLimitValue); synchronized void setMaxHistoryFiles(int maxHistoryFiles); synchronized void setFlushFrequency(int flushFrequency); synchronized void setCompressionOnRotation(boolean compressionOnRotation); synchronized void setLogStandardStreams(boolean logStandardStreams); static final int DISABLE_LOG_FILE_ROTATION_VALUE; static final int MINIMUM_ROTATION_LIMIT_VALUE; }### Answer:
@Test public void enablelogStandardStreams() throws IOException { gfFileHandler.setLogStandardStreams(true); assertNotSame("System.out should be redirected", System.out, origOut); assertNotSame("System.err should be redirected", System.err, origErr); }
@Test public void disabledlogStandardStreams() throws IOException { gfFileHandler.setLogStandardStreams(false); assertSame("System.out should not be redirected", System.out, origOut); assertSame("System.err should not be redirected", System.err, origErr); }