private static <T> void setSelectedItem(JComboBox<T> comboBox, T versionView) {
        // Imported projects might have outdated language/api versions - we display them as well (see createVersionValidator() for details)
        int index = ((MutableCollectionComboBoxModel<T>) comboBox.getModel()).getElementIndex(versionView);
        if (index == -1) {
            comboBox.addItem(versionView);
        }

        comboBox.setSelectedItem(versionView);
    }
private static <T> void setSelectedItem(JComboBox<T> comboBox, T versionView)