NodeComp extends AbstractComparator { @Override protected AtomicValue[] atomize(final Axis mOperand) throws SirixXPathException { final XmlNodeReadOnlyTrx rtx = asXdmNodeReadTrx(); final AtomicValue mAtomized = new AtomicValue( TypedValue.getBytes(((Long) rtx.getNodeKey()).toString()), rtx.keyForName("xs:integer")); final AtomicValue[] op = {mAtomized}; if (mOperand.hasNext()) { throw EXPathError.XPTY0004.getEncapsulatedException(); } else { return op; } } NodeComp(final XmlNodeReadOnlyTrx rtx, final Axis mOperand1, final Axis mOperand2,
      final CompKind mComp);   }
@Test public void testAtomize() throws SirixXPathException { Axis axis = new LiteralExpr(holder.getXmlNodeReadTrx(), -2); axis.hasNext(); axis.next(); AtomicValue[] value = comparator.atomize(axis); assertEquals(value.length, 1); assertEquals(holder.getXmlNodeReadTrx().getNodeKey(), value[0].getNodeKey()); assertEquals("xs:integer", value[0].getType()); try { axis = new DescendantAxis(holder.getXmlNodeReadTrx()); axis.hasNext(); comparator.atomize(axis); } catch (SirixXPathException e) { assertEquals( "err:XPTY0004 The type is not appropriate the expression or" + " the typedoes not match a required type as specified by the " + "matching rules.", e.getMessage()); } }