private void resetContent() throws Exception {
        if (outContent == null || outContent.size() > 0) {
            outContent = new ByteArrayOutputStream();
            System.setOut(new PrintStream(outContent, true, UTF_8.name()));
        }

        if (errContent == null || errContent.size() > 0) {
            errContent = new ByteArrayOutputStream();
            System.setErr(new PrintStream(errContent, true, UTF_8.name()));
        }
    }
clear outContent and errContent if they are not empty by create a new one.
set outContent and errContent as System.out and System.err
tika-app/src/test/java/org/apache/tika/cli/TikaCLIAsyncTest.java