int () { final int exitCode = super.getExitCode(); if (myExitFunc != null) { return myExitFunc.apply(exitCode, myCheckBox); } boolean checkBoxSelected = (myCheckBox != null && myCheckBox.isSelected()); boolean okExitCode = (exitCode == OK_EXIT_CODE); return checkBoxSelected && okExitCode ? OK_EXIT_CODE : CANCEL_EXIT_CODE; }