final ResultListener<List<SearchResultItem>> result = Mockito.mock(ResultListener.class);
manager.search(query, result);
session.verifyIQSent("<iq type='set' from='romeo@montague.net/home' to='search.service' xml:lang='en'>"
+ "<query xmlns='jabber:iq:search'> <last>Capulet</last> </query></iq>");
session.answerSuccess(new IQ(XMLBuilder.fromXML("<iq type='result' from='characters.shakespeare.lit' to='romeo@montague.net/home' id='search2' xml:lang='en'>"
+ "<query xmlns='jabber:iq:search'><item jid='juliet@capulet.com'>" + "<first>Juliet</first><last>Capulet</last><nick>JuliC</nick>"
+ "<email>juliet@shakespeare.lit</email></item>" + "<item jid='tybalt@shakespeare.lit'><first>Tybalt</first>"
+ "<last>Capulet</last><nick>ty</nick>" + "<email>tybalt@shakespeare.lit</email></item></query></iq>")));
Mockito.verify(result, Mockito.never()).onFailure(Matchers.anyString());
Mockito.verify(result).onSuccess(Matchers.argThat(new ArgumentMatcher<List<SearchResultItem>>() {