void () { ParametersList params = new ParametersList(); ParamsGroup group1 = params.addParamsGroup("id1"); group1.addParameter("group1_param1"); ParamsGroup group2 = params.addParamsGroup("id2"); group2.addParameter("group2_param1"); ParamsGroup group3 = params.addParamsGroup("id3"); group3.addParameter("group3_param1"); ParametersList params_clone = params.clone(); params.removeParamsGroup(0); group2.addParameter("group2_param2"); assertEquals("group2_param1 group2_param2 group3_param1", params.getParametersString().trim()); assertEquals("group1_param1 group2_param1 group3_param1", params_clone.getParametersString().trim()); }