public static void redirectSystemOutAndError(Configuration conf) {
        SystemOutMode systemOutMode = conf.get(TASK_MANAGER_SYSTEM_OUT_MODE);
        switch (systemOutMode) {
            case LOG:
                redirectToCurrentLog(
                        conf.get(TASK_MANAGER_SYSTEM_OUT_LOG_CACHE_SIZE).getBytes(),
                        conf.get(TASK_MANAGER_SYSTEM_OUT_LOG_THREAD_NAME));
                break;
            case IGNORE:
                ignoreSystemOutAndError();
                break;
            case DEFAULT:
            default:
                break;
        }
    }
@Test
    void testDefaultSystemOutAndErr() {
        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
        ByteArrayOutputStream errStream = new ByteArrayOutputStream();
        System.setOut(new PrintStream(outStream));
        System.setErr(new PrintStream(errStream));
        SystemOutRedirectionUtils.redirectSystemOutAndError(new Configuration());

        String logContext = "This is log context!";
        System.out.print(logContext);
        assertThat(outStream.toString()).isEqualTo(logContext);

        System.err.print(logContext);
        assertThat(errStream.toString()).isEqualTo(logContext);
    }