public static <T> boolean canRemoveSelectedItems(@NotNull JList<T> list, @Nullable Condition<? super T> condition) {
    int[] indices = list.getSelectedIndices();
    if (indices.length == 0) {
      return false;
    }
    ListModel<T> model = list.getModel();
    ListModelExtension<T, ListModel<T>> extension = getExtension(model);
    for (int index : indices) {
      if (index < 0 || index >= model.getSize()) continue;
      T obj = extension.get(model, index);
      if (condition == null || condition.value(obj)) {
        return true;
      }
    }

    return false;
  }
public static <T> boolean canRemoveSelectedItems(@NotNull JList<T> list, @Nullable Condition<? super T> condition)