### Question:
HiveStreamRedirector { public static void redirectToLogger(SessionState sessionState) { redirectToLogger(sessionState, null); } private  HiveStreamRedirector(); static void redirectToLogger(SessionState sessionState);  }### Answer:
@Test public void testLoggerRedirector() throws Exception { CountingLogger logger = new CountingLogger(); SessionState sessionState = new SessionState(new HiveConf()); HiveStreamRedirector.redirectToLogger(sessionState, logger); for (int i = 0; i < 5; i++) { sessionState.out.println("testInfoLog" + i); } Assert.assertEquals(5, logger.getInfoLogs()); }