### Question:
BagriXQItemAccessor extends BagriXQCloseable implements XQItemAccessor { @Override public double getDouble() throws XQException { checkState(ex_item_closed); if (type.getBaseType() == XQBASETYPE_DOUBLE) { return (Double) value; } if (type.getBaseType() == XQBASETYPE_FLOAT) { return ((Float) value).doubleValue(); } throw new XQException("ItemType is not double"); } 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 testGetDouble() throws XQException { XQPreparedExpression xqpe = xqc.prepareExpression("declare variable $v external; $v"); try { xqpe.bindDouble(new QName("v"), 1d, xqc.createAtomicType(XQItemType.XQBASETYPE_DOUBLE)); } catch (XQException e) { fail("A-XQDC-1.7: bindDouble() failed with message: " + e.getMessage()); } XQSequence xqs = xqpe.executeQuery(); xqs.next(); assertEquals("A-XQDC-1.7: Successful bindXXX.", XQItemType.XQITEMKIND_ATOMIC, xqs.getItemType().getItemKind()); assertEquals("A-XQDC-1.7: Successful bindXXX.", XQItemType.XQBASETYPE_DOUBLE, xqs.getItemType().getBaseType()); assertTrue("A-XQDC-1.7: Successful bindXXX.", 1d == xqs.getDouble()); xqpe.close(); }