public static void writeLines(OutputStream os, String[] lines) throws IOException {
        try (PrintWriter writer = new PrintWriter(new OutputStreamWriter(os))) {
            for (String line : lines) {
                writer.println(line);
            }
            writer.flush();
        }
    }
@Test
    void testWriteLines() throws Exception {
        IOUtils.writeLines(os, new String[] {TEXT});
        ByteArrayOutputStream bos = (ByteArrayOutputStream) os;
        assertThat(new String(bos.toByteArray()), equalTo(TEXT + System.lineSeparator()));
    }