// item.getPresence().getType());
}
@Test
public void shouldUpdateItem() {
final RosterItemChangedTestHandler handler = new RosterItemChangedTestHandler();
roster.addRosterItemChangedHandler(handler);
session.receives("<iq type='set'><query xmlns='jabber:iq:roster'>" + "<item jid='friend@domain' name='Friend1'><group>GG1</group><group>GG2</group>"
+ "</item></query></iq>");
session.receives("<iq type='set'><query xmlns='jabber:iq:roster'>" + "<item jid='friend@domain' name='Friend2'><group>HH1</group><group>HH2</group>"
+ "</item></query></iq>");
assertEquals("RosterItemChangedHandler should be called twice", 2, handler.getCalledTimes());
assertEquals(1, roster.getItems().size());
assertEquals(3, roster.getGroupNames().size());
assertTrue(roster.getGroupNames().contains("HH1"));
assertTrue(roster.getGroupNames().contains("HH2"));
}