private static boolean isLeadSelectionNeeded(@NotNull JList list, int row) {
    return list.getMinSelectionIndex() < list.getMaxSelectionIndex() && list.isSelectedIndex(row - 1) && list.isSelectedIndex(row + 1);
  }
private static boolean isLeadSelectionNeeded(@NotNull JList list, int row)