void () { ParametersList params = new ParametersList(); params.add("param1"); ParamsGroup group1 = params.addParamsGroup("id1"); group1.addParameter("group1_param1"); params.add("param2"); group1.addParameter("group1_param2"); ParamsGroup group2 = params.addParamsGroup("id2"); group2.addParameter("group2_param1"); params.add("param3"); assertEquals(asList("param1", "param2", "param3"), params.getParameters()); assertEquals(asList("param1", "param2", "param3", "group1_param1", "group1_param2", "group2_param1"), params.getList()); assertArrayEquals(new String[]{"param1", "param2", "param3", "group1_param1", "group1_param2", "group2_param1"}, params.getArray()); assertEquals("param1 param2 param3 group1_param1 group1_param2 group2_param1", params.getParametersString().trim()); ParametersList group1_params = group1.getParametersList(); assertEquals(asList("group1_param1", "group1_param2"), group1_params.getParameters()); assertEquals(asList("group1_param1", "group1_param2"), group1_params.getList()); assertArrayEquals(new String[]{"group1_param1", "group1_param2"}, group1_params.getArray()); assertEquals("group1_param1 group1_param2", group1_params.getParametersString().trim()); ParametersList group2_params = group2.getParametersList(); assertEquals(asList("group2_param1"), group2_params.getParameters()); assertEquals(asList("group2_param1"), group2_params.getList()); assertArrayEquals(new String[]{"group2_param1"}, group2_params.getArray()); assertEquals("group2_param1", group2_params.getParametersString().trim()); }