@VisibleForTesting
    static void redirectToLoggingRedirector(
            LoggingRedirector outRedirector,
            LoggingRedirector errRedirector,
            long byteLimitEachLine,
            boolean logThreadName) {
        System.setOut(new LoggingPrintStream(outRedirector, byteLimitEachLine, logThreadName));
        System.setErr(new LoggingPrintStream(errRedirector, byteLimitEachLine, logThreadName));
    }
@Test
    void testByteLimitEachLine() {
        int byteLimitEachLine = 100;
        SystemOutRedirectionUtils.redirectToLoggingRedirector(
                outCollector::add, errCollector::add, byteLimitEachLine, false);

        StringBuilder expectedContext = new StringBuilder();
        for (int i = 0; i < byteLimitEachLine; i++) {
            assertThat(outCollector).isEmpty();
            assertThat(errCollector).isEmpty();
            System.out.print('a');
            System.err.print('a');
            expectedContext.append('a');
        }
        assertThat(outCollector.poll()).isEqualTo(expectedContext.toString());
    }