private void restoreOutputStream() {
    System.out.flush();
    System.setOut(origOut);

    System.err.flush();
    System.setErr(origErr);
  }
This method is used for verifying CMD to see whether the output contains the keywords provided.
beeline/src/test/org/apache/hive/beeline/cli/TestHiveCli.java