public void setSuggestions(final String @NotNull [] suggestions) {
    if(myComboBoxModel == null) return;
    @SuppressWarnings("unchecked") JComboBox<String> comboBox = (JComboBox<String>)myComponent;
    final String oldSelectedItem = (String)comboBox.getSelectedItem();
    final String oldItemFromTextField = (String) comboBox.getEditor().getItem();
    final boolean shouldUpdateTextField = oldItemFromTextField.equals(oldSelectedItem) || oldItemFromTextField.isBlank();
    myComboBoxModel.setSuggestions(suggestions);
    if(suggestions.length > 0 && shouldUpdateTextField) {
      if (oldSelectedItem != null) {
        comboBox.setSelectedItem(oldSelectedItem);
      } else {
        comboBox.setSelectedIndex(0);
      }
    }
    else {
      comboBox.getEditor().setItem(oldItemFromTextField);
    }
  }
public void setSuggestions(final String @NotNull [] suggestions)