public static <T> boolean selectItem(@NotNull JList<T> list, @NotNull T item) {
    ListModel<T> model = list.getModel();
    for (int i = 0; i < model.getSize(); i++) {
      T anItem = model.getElementAt(i);
      if (item.equals(anItem)) {
        selectItem(list, i);
        return true;
      }
    }
    return false;
  }
public static <T> boolean selectItem(@NotNull JList<T> list, @NotNull T item)