@Test
  public void testPatchSave() throws Exception {

    final CommentedOption commentedOption = new CommentedOption("hello");
    when(commentedOptionFactory.makeCommentedOption("message")).thenReturn(commentedOption);

    saver.save(pathToPom, new ProjectScreenModel(), "message");

    verify(ioService).startBatch(any(FileSystem.class), eq(commentedOption));

    verify(ioService).endBatch();
  }
  @Test
  public void testPOMSave() throws Exception {

    final ProjectScreenModel model = new ProjectScreenModel();
    final POM pom = new POM();
    model.setPOM(pom);
    final Metadata pomMetaData = new Metadata();
    model.setPOMMetaData(pomMetaData);

    saver.save(pathToPom, model, "message");

    verify(pomService).save(eq(pathToPom), eq(pom), eq(pomMetaData), eq("message"));
  }
  @Test
  public void testWhiteListSave() throws Exception {

    final ProjectScreenModel model = new ProjectScreenModel();
    final WhiteList whiteList = new WhiteList();
    model.setWhiteList(whiteList);
    final Path pathToWhiteList = mock(Path.class);
    model.setPathToWhiteList(pathToWhiteList);
    final Metadata metadata = new Metadata();
    model.setWhiteListMetaData(metadata);

    saver.save(pathToPom, model, "message white list");

    verify(whiteListService)
        .save(eq(pathToWhiteList), eq(whiteList), eq(metadata), eq("message white list"));
  }
  @Test
  public void testImportsSave() throws Exception {

    final ProjectScreenModel model = new ProjectScreenModel();
    final ProjectImports projectImports = new ProjectImports();
    model.setProjectImports(projectImports);
    final Path pathToImports = mock(Path.class);
    model.setPathToImports(pathToImports);
    final Metadata metadata = new Metadata();
    model.setProjectImportsMetaData(metadata);

    saver.save(pathToPom, model, "message imports");

    verify(importsService)
        .save(eq(pathToImports), eq(projectImports), eq(metadata), eq("message imports"));
  }
  @Test
  public void testKModuleSave() throws Exception {

    final ProjectScreenModel model = new ProjectScreenModel();
    final KModuleModel kModule = new KModuleModel();
    model.setKModule(kModule);
    final Path pathToKModule = mock(Path.class);
    model.setPathToKModule(pathToKModule);
    final Metadata metadata = new Metadata();
    model.setKModuleMetaData(metadata);

    saver.save(pathToPom, model, "message kmodule");

    verify(kModuleService)
        .save(eq(pathToKModule), eq(kModule), eq(metadata), eq("message kmodule"));
  }