### Question:
BagriXQItemAccessor extends BagriXQCloseable implements XQItemAccessor { @Override public int getInt() throws XQException { checkState(ex_item_closed); return (int) convertDecimal(Integer.MIN_VALUE, Integer.MAX_VALUE, "int"); } BagriXQItemAccessor(XQProcessor xqProcessor); @Override boolean getBoolean(); @Override byte getByte(); @Override double getDouble(); @Override float getFloat(); @Override int getInt(); @Override XQItemType getItemType(); @Override String getAtomicValue(); @Override long getLong(); @Override Node getNode(); @Override URI getNodeUri(); @Override Object getObject(); @Override XMLStreamReader getItemAsStream(); @Override String getItemAsString(Properties props); @Override short getShort(); @Override boolean instanceOf(XQItemType type); @Override void writeItem(OutputStream os, Properties props); @Override void writeItem(Writer ow, Properties props); @Override void writeItemToSAX(ContentHandler saxhdlr); @Override void writeItemToResult(Result result);  }### Answer:
@Test public void testGetInt() throws XQException { XQExpression xqe = xqc.createExpression(); XQSequence xqs = xqe.executeQuery("xs:int('1'), 10.0"); xqs.next(); try { assertEquals("A-XQIA-1.6: getInt on xs:int failed", 1, xqs.getInt()); } catch (XQException e) { fail("A-XQIA-1.6: getInt on xs:int failed with message: " + e.getMessage()); } xqs.next(); try { assertEquals("A-XQIA-1.6: getInt on xs:decimal failed", 10, xqs.getInt()); } catch (XQException e) { fail("A-XQIA-1.6: getInt on xs:decimal failed with message: " + e.getMessage()); } xqe.close(); }
@Test public void testBasicType() throws XQException { XQExpression xqe = xqc.createExpression(); XQSequence xqs = xqe.executeQuery("1,2"); boolean b = xqs.next(); assertEquals("A-XQS-18.1: next() failed", true, b); int type = xqs.getInt(); assertEquals("A-XQS-18.1: next() failed", 1, type); }