docs: public void merge(MtasSolrCollectionResult newItem) throws IOException {
      if (action != null && newItem.action != null) {
        if (action.equals(ComponentCollection.ACTION_CREATE)
            && newItem.action.equals(ComponentCollection.ACTION_CREATE)) {
          values.addAll(newItem.values);
          if (id != null && (newItem.id == null || !newItem.id.equals(id))) {
            id = null;
          }
        } else if (action.equals(ComponentCollection.ACTION_LIST)) {
          if (list != null) {
            HashMap<String, SimpleOrderedMap<Object>> index = new HashMap<>();
            for (SimpleOrderedMap<Object> item : list) {
              if (item.get("id") != null && item.get("id") instanceof String) {
                index.put((String) item.get("id"), item);
                if (item.get("shards") == null
                    || !(item.get("shards") instanceof List)) {
                  item.add("shards", new ArrayList<>());
                }
              }
            }
            for (SimpleOrderedMap<Object> item : newItem.list) {
              if (item.get("id") != null && item.get("id") instanceof String) {
                String id = (String) item.get("id");
                if (index.containsKey(id)) {
                  SimpleOrderedMap<Object> indexItem = index.get(id);
                  List<SimpleOrderedMap<Object>> shards;
                  if (indexItem.get("shards") != null
                      && indexItem.get("shards") instanceof List) {
                    shards = (List<SimpleOrderedMap<Object>>) indexItem
                        .get("shards");
                  } else {
                    shards = new ArrayList<>();
                    indexItem.add("shards", shards);
                  }
                  shards.add(item);
                }
              }
            }
          }
        } else if (action.equals(ComponentCollection.ACTION_CHECK)
            || action.equals(ComponentCollection.ACTION_POST)
            || action.equals(ComponentCollection.ACTION_IMPORT)
            || action.equals(ComponentCollection.ACTION_CREATE)
            || action.equals(ComponentCollection.ACTION_GET)) {
          if (status != null && status.get("id") != null
              && status.get("id") instanceof String) {
            String id = (String) status.get("id");
            if (id.equals(newItem.id)) {
              List<SimpleOrderedMap<Object>> shards;
              if (status.get("shards") != null
                  && status.get("shards") instanceof List) {
                shards = (List<SimpleOrderedMap<Object>>) status.get("shards");
              } else {
                shards = new ArrayList<>();
                status.add("shards", shards);
              }
              if (newItem.status != null) {
                if (action.equals(ComponentCollection.ACTION_GET)) {
                  newItem.status.add("values", newItem.values);
                }
                shards.add(newItem.status);
              }
            }
          }
        } else {
          throw new IOException("not allowed for action '" + action + "'");
        }
      }
    }