public static int showCheckboxOkCancelDialog(@DialogMessage String message,
                                               @DialogTitle String title,
                                               @NlsContexts.Checkbox String checkboxText,
                                               final boolean checked,
                                               final int defaultOptionIndex,
                                               final int focusedOptionIndex,
                                               Icon icon) {
    return showCheckboxMessageDialog(message, title, new String[]{getOkButton(), getCancelButton()}, checkboxText, checked, defaultOptionIndex,
                                     focusedOptionIndex, icon,
                                     (BiFunction<? super Integer, ? super JCheckBox, Integer>) 
                                       (exitCode, cb) -> exitCode == -1 ? CANCEL : exitCode + (cb.isSelected() ? 1 : 0));
  }
public static int showCheckboxOkCancelDialog(@DialogMessage String message,
                                               @DialogTitle String title,
                                               @NlsContexts.Checkbox String checkboxText,
                                               final boolean checked,
                                               final int defaultOptionIndex,
                                               final int focusedOptionIndex,
                                               Icon icon)