template.insert(new Person("Tom", 21));
template.insert(new Person("Dick", 22));
template.insert(new Person("Harry", 23));
Query query = new Query(Criteria.where("firstName").is("Harry"));
Update update = new Update().inc("age", 1);
Person p = template.findAndModify(query, update, Person.class); // return old
assertThat(p.getFirstName(), is("Harry"));
assertThat(p.getAge(), is(23));
p = template.findOne(query, Person.class);
assertThat(p.getAge(), is(24));