private ContentValues[] getContentValuesForThings(ThingResponseGroup2 response) {
    ContentValues[] thingValues =
        new ContentValues
            [response.getThing().size() + response.getUnprocessedThingKeyInfo().size()];

    int idx = 0;

    for (Thing2 thing : response.getThing()) {
      ContentValues values = new ContentValues();

      values.put("thing_id", thing.getThingId().getValue());
      values.put("version_stamp", thing.getThingId().getVersionStamp());
      values.put("thing_xml", XmlSerializer.safeWrite(thing));

      thingValues[idx++] = values;
    }

    for (UnprocessedThingKeyInfo keys : response.getUnprocessedThingKeyInfo()) {
      ContentValues values = new ContentValues();

      values.put("thing_id", keys.getThingId().getValue());
      values.put("version_stamp", keys.getThingId().getVersionStamp());

      thingValues[idx++] = values;
    }

    return thingValues;
  }
  private ThingRequestGroup2 getQueryWithKeys(List<UnprocessedThingKeyInfo> keys) {
    ThingRequestGroup2 query = new ThingRequestGroup2();
    query.setMax(Integer.MAX_VALUE);
    query.setMaxFull(Integer.MAX_VALUE);
    query.getFormat().getXml();

    for (UnprocessedThingKeyInfo key : keys) {
      query.getThingIdList().add(key.getThingId().getValue());
    }

    return query;
  }