### Question:
FileProjectSaver implements ProjectSaver { @Override public void saveAs(Project project, Resource baseDirectory) { if (baseDirectory == null) { throw new NullPointerException("Null 'baseDirectory'"); } save(project, baseDirectory, false); } FileProjectSaver(@Inject List<ProjectExtension> extensions); @Override String getSupportedVersion(); @Override void save(Project project); @Override void saveAs(Project project, Resource baseDirectory);  }### Answer:
@Test public void testSaveAs_Sorted() throws Exception { File testFolder = setupTestDirectory("testSaveAs_Sorted"); DataChannelDescriptor rootNode = new DataChannelDescriptor(); rootNode.setName("test"); rootNode.getDataMaps().add(new DataMap("C")); rootNode.getDataMaps().add(new DataMap("B")); rootNode.getDataMaps().add(new DataMap("A")); DataNodeDescriptor[] nodes = new DataNodeDescriptor[3]; nodes[0] = new DataNodeDescriptor("Z"); nodes[1] = new DataNodeDescriptor("Y"); nodes[2] = new DataNodeDescriptor("X"); nodes[0].getDataMapNames().add("C"); nodes[0].getDataMapNames().add("B"); nodes[0].getDataMapNames().add("A"); rootNode.getNodeDescriptors().addAll(Arrays.asList(nodes)); Project project = new Project(new ConfigurationTree<DataChannelDescriptor>( rootNode)); saver.saveAs(project, new URLResource(testFolder.toURI().toURL())); File target = new File(testFolder, "cayenne-test.xml"); assertTrue(target.isFile()); assertSaveAs_Sorted(target); }