public static <T> boolean canMoveSelectedItemsUp(@NotNull JList<T> list) {
    int[] indices = list.getSelectedIndices();
    return indices.length > 0 && indices[0] > 0;
  }
public static <T> boolean canMoveSelectedItemsUp(@NotNull JList<T> list)