if (!(iq.getType() == Type.get || iq.getType() == Type.result)) {
if (!(iq.getType() == Type.get || iq.getType() == Type.set)) {
    public static IQ createResultIQ(IQ iq) {        if (!(iq.getType() == Type.get || iq.getType() == Type.result)) {            throw new IllegalArgumentException("IQ must be of type 'set' or 'get'.");        }        IQ result = new IQ(Type.result, iq.getID());        result.setFrom(iq.getTo());        result.setTo(iq.getFrom());        Element childElement = iq.getChildElement();        if (childElement != null) {            Element resultChild = docFactory.createElement(childElement.getName(),                    childElement.getNamespaceURI());            result.setChildElement(resultChild);        }        return result;    }