@Test
    public void testMaxItems1() {
        var schema = """
                {
                    "items": {
                        "type": "boolean"
                    },
                    "maxItems": 1
                }
                """;
        var expectedGrammar = """
                boolean ::= ("true" | "false") space
                root ::= "[" space boolean? "]" space
                space ::= | " " | "\\n" [ \\t]{0,20}
                """;

        var actualGrammar = JsonSchemaToGrammar.convert(schema);
        assertEquals(expectedGrammar, actualGrammar);
    }
These tests are based on C++ unit tests from llama.cpp repository.
model-integration/src/test/java/ai/vespa/llm/clients/JsonSchemaToGrammarTest.java