int (@NotNull CoverageSuite suite) { final CoverageOptionsProvider coverageOptionsProvider = CoverageOptionsProvider.getInstance(myProject); Function<Integer, Integer> mapCode = (Integer exitCode) -> { return switch (exitCode) { case MessageConstants.YES -> CoverageOptionsProvider.REPLACE_SUITE; case MessageConstants.NO -> CoverageOptionsProvider.ADD_SUITE; default -> CoverageOptionsProvider.IGNORE_SUITE; }; }; var doNotAskOption = new DoNotAskOption.Adapter() { @Override public void rememberChoice(boolean isSelected, int exitCode) { if (isSelected) { coverageOptionsProvider.setOptionsToReplace(mapCode.apply(exitCode)); } } }; String title = CoverageBundle.message("code.coverage"); String message = CoverageBundle.message("display.coverage.prompt", suite.getPresentableName()); int result = MessageDialogBuilder.yesNoCancel(title, message) .yesText(CoverageBundle.message("coverage.replace.active.suites")) .noText(CoverageBundle.message("coverage.add.to.active.suites")) .cancelText(CoverageBundle.message("coverage.do.not.apply.collected.coverage")) .doNotAsk(doNotAskOption) .show(suite.getProject()); return mapCode.apply(result); }