void () { ParametersList params = new ParametersList(); ParamsGroup group1 = params.addParamsGroup("id1"); group1.addParameter("group1_param1"); group1.addParameter("group1_param2"); ParamsGroup group2 = params.addParamsGroup("id2"); group2.addParameter("group2_param1"); ParamsGroup group1_1 = group1.getParametersList().addParamsGroup("id1_1"); group1_1.addParameter("group1_1_param1"); ParamsGroup group1_2 = group1.getParametersList().addParamsGroup("id1_2"); group1_2.addParameter("group1_2_param1"); assertEquals(asList("group1_param1", "group1_param2", "group1_1_param1", "group1_2_param1", "group2_param1"), params.getList()); assertEquals(asList("group1_param1", "group1_param2", "group1_1_param1", "group1_2_param1", "group2_param1"), params.getList()); assertEquals("group1_param1 group1_param2 group1_1_param1 group1_2_param1 group2_param1", params.getParametersString().trim()); }