private void updateSelection(JList list) {
    int selection = list.getSelectedIndices().length == 1 ? list.getSelectedIndex() : -1;
    handleSelectionChange(selection == -1 ? null : Integer.valueOf(selection));
  }
private void updateSelection(JList list)