@Test
    void inlineAndIncludeScripts() throws IOException {
        writer.startElement("body", null);
        verify(wrappedWriter).startElement("body", null);

        writer.startElement("script", null);
        writer.writeAttribute("src", "include", null);
        writer.writeAttribute("charset", "UTF-8", null);
        writer.endElement("script");

        writer.startElement("script", null);
        writer.writeText("inline", null);
        writer.endElement("script");

        writer.endElement("body");

        assertEquals(1, state.getIncludes().get("text/javascript").size());
        assertEquals(1, state.getInlines().get("text/javascript").size());
        verify(wrappedWriter, times(2)).startElement("script", null);
        verify(wrappedWriter).writeAttribute("src", "include", null);
        verify(wrappedWriter).writeAttribute("charset", "UTF-8", null);
        verify(wrappedWriter).write(contains("inline"));
    }
https://github.com/primefaces/primefaces/issues/10845
primefaces/src/test/java/org/primefaces/application/resource/MoveScriptsToBottomResponseWriterTest.java