RenamePopUpPresenter { public void rename(final String newName) { final String fileName = newFileName(newName); final String comment = toggleCommentPresenter.getComment(); final ValidatorWithReasonCallback callback = validatorCallback(comment, newName, renameCommand); validator.validate(fileName, callback); } @Inject  RenamePopUpPresenter(final View view,
                                final ToggleCommentPresenter toggleCommentPresenter); void show(final Path path,
                     final Validator validator,
                     final CommandWithFileNameAndCommitMessage renameCommand,
                     final CommandWithFileNameAndCommitMessage saveAndRenameCommand,
                     final boolean isDirty,
                     final String originalFileName); void show(final Path path,
                     final CommandWithFileNameAndCommitMessage renameCommand,
                     final String originalFileName); void show(final Path path,
                     final Validator validator,
                     final CommandWithFileNameAndCommitMessage renameCommand); void show(final Path path,
                     final Validator validator,
                     final boolean isDirty,
                     final CommandWithFileNameAndCommitMessage renameCommand,
                     final CommandWithFileNameAndCommitMessage saveAndRenameCommand); void show(final Path path,
                     final CommandWithFileNameAndCommitMessage renameCommand); @PostConstruct void setup(); void rename(final String newName); void saveAndRename(final String newName); void cancel(); View getView(); ToggleCommentPresenter getToggleCommentPresenter();  }
@Test public void testRename() throws Exception { when(path.getFileName()).thenReturn("file.plugin"); presenter.show(path, validator, renameCommand); presenter.rename("newFile"); verify(validator).validate(eq("newFile.plugin"), any(ValidatorWithReasonCallback.class)); }