Map<String, AttributeValueUpdate> oldValues = new HashMap<String, AttributeValueUpdate> ();
oldValues.put("count", new AttributeValueUpdate(new AttributeValue().withN("100"), AttributeAction.PUT));
oldValues.put("ids", new AttributeValueUpdate(new AttributeValue().withS("[er, er]"), AttributeAction.ADD));
UpdateItemRequest update = new UpdateItemRequest(tableName, key, oldValues);
getClient().updateItem(update);
//conditional update
HashMap<String, AttributeValueUpdate> newValues = new HashMap<String, AttributeValueUpdate> ();
newValues.put("count", new AttributeValueUpdate(new AttributeValue().withN("102"), AttributeAction.PUT));
newValues.put("ids", new AttributeValueUpdate(new AttributeValue().withS("[er, er]"), AttributeAction.DELETE));
HashMap<String, ExpectedAttributeValue> expectedValues = new HashMap<String, ExpectedAttributeValue> ();
expectedValues.put("count", new ExpectedAttributeValue().withValue(new AttributeValue().withN("100")));
update = new UpdateItemRequest().withTableName(tableName).withKey(key).withAttributeUpdates(newValues).withExpected(expectedValues);
getClient().updateItem(update);
inProcessClient.save(PERSISTENCE_PATH);
createNewInProcessClient().restore(PERSISTENCE_PATH);