@Test
    void queryLanguageAlternatives() {
        // Given:
        // Person = {
        //  Name: 'Joe',
        //  Hobbies: ['sports','books','bonzais'],
        //  Phones: [{Number: '12-3456-7890', areaCode: 'NY'},{Number: '22-3456-7890', areaCode: 'CA'}],
        //  Mother: {
        //    Name: 'Mom',
        //    Birthyear: '1961'
        //  }
        //}

        { // Select all Persons whose hobbies contains 'sport'
            // YQL
            Query yqlQuery = new Query(httpEncode("?query=select * from Persons where hobbies contains 'sports'&type=yql"));
            assertEquals("hobbies:sports", yqlQuery.getModel().getQueryTree().toString());

            // JSON
            Query jsonQuery = new Query(httpEncode("?select.where={\"contains\" : [ \"hobbies\", \"sports\" ]}&type=select"));
            assertEquals("hobbies:sports", jsonQuery.getModel().getQueryTree().toString());

            // Programmatically
            Query query = new Query();
            query.getModel().getQueryTree().setRoot(new WordItem("sports", "hobbies"));
            assertEquals("hobbies:sports", query.getModel().getQueryTree().toString());
        }

        { // Select all Persons whose Phones areaCode equals 'NY'
            // YQL
            Query yqlQuery = new Query(httpEncode("?query=select * from Persons where phones.areaCode contains 'NY'&type=yql"));
            assertEquals("phones.areaCode:NY", yqlQuery.getModel().getQueryTree().toString());

            // JSON
            Query jsonQuery = new Query(httpEncode("?select.where={\"contains\" : [ \"phones.areaCode\", \"NY\" ]}&type=select"));
            assertEquals("phones.areaCode:NY", jsonQuery.getModel().getQueryTree().toString());

            // Programmatically
            Query query = new Query();
            query.getModel().getQueryTree().setRoot(new WordItem("NY", "phones.areaCode"));
            assertEquals("phones.areaCode:NY", query.getModel().getQueryTree().toString());
        }

        { // Select all Persons whose Mother's Birthyear is greater than 1960
            // YQL
            Query yqlQuery = new Query(httpEncode("?query=select * from Persons where mother.Birthyear > 1960&type=yql"));
            assertEquals("mother.Birthyear:>1960", yqlQuery.getModel().getQueryTree().toString());

            // JSON
            Query jsonQuery = new Query(httpEncode("?select.where={\"range\" : [ \"mother.Birthyear\", { \">\": 1960}]}&type=select"));
            assertEquals("mother.Birthyear:>1960", jsonQuery.getModel().getQueryTree().toString());

            // Programmatically
            Query query = new Query();
            query.getModel().getQueryTree().setRoot(new IntItem(">1960", "mother.Birthyear"));
            assertEquals("mother.Birthyear:>1960", query.getModel().getQueryTree().toString());
        }
    }
Test that we get the last value if a parameter is assigned multiple times
container-search/src/test/java/com/yahoo/search/test/QueryTestCase.java