items.add(new Item(new JID(jid), name, Ask.valueOf(ask), Subscription.valueOf(subscription), groups));
Ask askStatus = ask == null ? null : Ask.valueOf(ask); Subscription subStatus = subscription == null ? null : Subscription.valueOf(subscription); items.add(new Item(new JID(jid), name, askStatus, subStatus, groups));
    public Collection<Item> getItems() {        Collection<Item> items = new ArrayList<Item>();        Element query = element.element(new QName("query", Namespace.get("jabber:iq:roster")));        if (query != null) {            for (Iterator i=query.elementIterator("item"); i.hasNext(); ) {                Element item = (Element)i.next();                String jid = item.attributeValue("jid");                String name = item.attributeValue("name");                String ask = item.attributeValue("ask");                String subscription = item.attributeValue("subscription");                Collection<String> groups = new ArrayList<String>();                for (Iterator j=item.elementIterator("group"); j.hasNext(); ) {                    Element group = (Element)j.next();                    groups.add(group.getTextTrim());                }                items.add(new Item(new JID(jid), name, Ask.valueOf(ask),                        Subscription.valueOf(subscription), groups));            }        }        return Collections.unmodifiableCollection(items);    }