private static void selectOrAddSelection(@NotNull ListSelectionModel selectionModel,
                                           int indexToSelect,
                                           @JdkConstants.InputEventMask int modifiers) {
    if (selectionModel.getSelectionMode() == ListSelectionModel.SINGLE_SELECTION) {
      selectionModel.setSelectionInterval(indexToSelect,indexToSelect);
    }
    else {
      if ((modifiers & InputEvent.SHIFT_DOWN_MASK) == 0) {
        selectionModel.setSelectionInterval(indexToSelect, indexToSelect);
      }
      else {
        selectionModel.addSelectionInterval(indexToSelect, indexToSelect);
      }
    }
  }
private static void selectOrAddSelection(@NotNull ListSelectionModel selectionModel,
                                           int indexToSelect,
                                           @JdkConstants.InputEventMask int modifiers)