CopyPopUpPresenter { public void copy(String newName) { final String newFileName = newName + extension(path.getFileName()); validator.validate(newFileName, validatorCallback(toggleCommentPresenter.getComment(), newName)); } @Inject  CopyPopUpPresenter(@Customizable View view,
                              ToggleCommentPresenter toggleCommentPresenter); @PostConstruct void setup(); void show(Path path,
                     Validator validator,
                     CommandWithFileNameAndCommitMessage command); void show(final Path path,
                     final CommandWithFileNameAndCommitMessage copyPopupCommand); void cancel(); View getView(); void copy(String newName); ToggleCommentPresenter getToggleCommentPresenter(); Path getPath();  }
@Test public void testCopy() throws Exception { when(path.getFileName()).thenReturn("file.plugin"); when(toggleCommentPresenter.getComment()).thenReturn("comment"); presenter.show(path, validator, command); presenter.copy("newFile"); verify(validator).validate(eq("newFile.plugin"), any(ValidatorWithReasonCallback.class)); }