@Test
    public void testConflictingNames() {
        var schema = """
                {
                    "type": "object",
                    "properties": {
                        "number": {
                        "type": "object",
                        "properties": {
                            "number": {
                            "type": "object",
                                "properties": {
                                    "root": {
                                        "type": "number"
                                    }
                                },
                                "required": [
                                    "root"
                                ],
                                "additionalProperties": false
                            }
                        },
                        "required": [
                            "number"
                        ],
                        "additionalProperties": false
                        }
                    },
                    "required": [
                        "number"
                    ],
                    "additionalProperties": false,
                    "definitions": {}
                }
                """;
        var expectedGrammar = """
                decimal-part ::= [0-9]{1,16}
                integral-part ::= [0] | [1-9] [0-9]{0,15}
                number ::= ("-"? integral-part) ("." decimal-part)? ([eE] [-+]? integral-part)? space
                number- ::= "{" space number-number-kv "}" space
                number-kv ::= "\\"number\\"" space ":" space number-
                number-number ::= "{" space number-number-root-kv "}" space
                number-number-kv ::= "\\"number\\"" space ":" space number-number
                number-number-root-kv ::= "\\"root\\"" space ":" space number
                root ::= "{" space number-kv "}" 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