Groups implements java.io.Serializable { public void storeToXML(OutputStream out,String comment,String encoding) throws IOException { XMLUtils.save(this, out, comment, encoding); }  Set<String> getGroupNames(); Properties getGroup(String groupName); void addGroup(String groupName,Properties properties); Properties removeGroup(String groupName); void removeAllGroup(String groupName); boolean containsGroup(String groupName); boolean isEmpty(); int size(); Map<String, Properties> getGroups(); void setGroups(Map<String, Properties> groups); void mergeGroups(Groups g); void loadFromXML(InputStream in); void storeToXML(OutputStream out,String comment,String encoding); void storeToXML(OutputStream out,String comment); void storeToXML(OutputStream out); Properties toProperties(); Properties toProperties(String seperator); void storeAsWindowsInI(Writer writer);  }
@Test public void test_storeToXML_and_loadFromXML() throws InvalidPropertiesFormatException, IOException { Properties props = new Properties(); props.setProperty("1", "1"); props.setProperty("1222", "222"); props.storeToXML(System.out, "comment"); System.out.println("\n\n"); props.store(System.out, "comments"); System.out.println("\n\n"); Groups g = verifyXml(new FileInputStream(ResourceUtils.getFile("classpath:cn/org/rapid_framework/config/group/groups_test.xml"))); g.storeToXML(System.out); ByteArrayOutputStream out = new ByteArrayOutputStream(); g.storeToXML(out); verifyXml(new ByteArrayInputStream(out.toByteArray())); }