if (!test.isWildcardTest()) {
if (test.isWildcardTest()) { NodeSet result = new ExtArrayNodeSet(contextSet.getLength()); for (Iterator i = contextSet.iterator(); i.hasNext();) { NodeProxy current = (NodeProxy) i.next(); StoredNode currentNode = (StoredNode) current.getNode(); while ((currentNode = getNextSibling(currentNode)) != null) { if (test.matches(currentNode)) { NodeProxy sibling = new NodeProxy((DocumentImpl) currentNode.getOwnerDocument(), currentNode.getGID(), currentNode.getInternalAddress()); if (inPredicate) sibling.addContextNode(current); else sibling.copyContext(current); result.add(sibling); } } } return result; } else {
	protected NodeSet getSiblings(XQueryContext context, NodeSet contextSet) {				if (!test.isWildcardTest()) {		    DocumentSet docs = getDocumentSet(contextSet);			if (currentSet == null || currentDocs == null || !(docs.equals(currentDocs))) {                ElementIndex index = context.getBroker().getElementIndex();	                if (context.getProfiler().isEnabled())                    context.getProfiler().message(this, Profiler.OPTIMIZATIONS,                             "OPTIMIZATION", "using index '" + index.toString() + "'"); 				currentSet = index.findElementsByTagName(ElementValue.ELEMENT, docs, test.getName(), null);                currentDocs = docs;                registerUpdateListener();			}             switch (axis) {                case Constants.PRECEDING_SIBLING_AXIS :                                 return currentSet.selectSiblings(contextSet, NodeSet.PRECEDING);                                    case Constants.FOLLOWING_SIBLING_AXIS :                    return currentSet.selectSiblings(contextSet, NodeSet.FOLLOWING);                                   default :                    throw new IllegalArgumentException("Unsupported axis specified");                               }					} else {			NodeSet result = new ExtArrayNodeSet(contextSet.getLength());			NodeProxy p, sib;			StoredNode n;			for (Iterator i = contextSet.iterator(); i.hasNext();) {				p = (NodeProxy) i.next();				n = (StoredNode) p.getNode();				while ((n = getNextSibling(n)) != null) {					if (test.matches(n)) {						sib = new NodeProxy((DocumentImpl) n.getOwnerDocument(), n.getGID(),								n.getInternalAddress());                        if (inPredicate)                            sib.addContextNode(p);                        else                            sib.copyContext(p);                        result.add(sib);					}				}			}            return result;		}			}