public boolean isModified(@NotNull List<? extends Pair<T, Boolean>> oldItems) {
    if (oldItems.size() != list.getItemsCount()) {
      return true;
    }

    for (int i = 0; i < list.getItemsCount(); i++) {
      T item = list.getItemAt(i);
      if (item == null) {
        return true;
      }

      Pair<T, Boolean> oldItem = oldItems.get(i);
      if (oldItem.second != list.isItemSelected(i) || !oldItem.first.equals(item)) {
        return true;
      }
    }
    return false;
  }
public boolean isModified(@NotNull List<? extends Pair<T, Boolean>> oldItems)