### Question:
BagriXQSequence extends BagriXQItemAccessor implements XQSequence { @Override public XQItem getItem() throws XQException { checkState(ex_sequence_closed); return new BagriXQItem(getXQProcessor(), type, value); } BagriXQSequence(BagriXQDataFactory xqFactory, XQProcessor xqProcessor); @Override XQItem getItem(); @Override XMLStreamReader getSequenceAsStream(); @Override String getSequenceAsString(Properties props); @Override void writeSequence(OutputStream os, Properties props); @Override void writeSequence(Writer ow, Properties props); @Override void writeSequenceToSAX(ContentHandler saxhdlr); @Override void writeSequenceToResult(Result result);  }### Answer:
@Test public void testGetItem() throws XQException { XQExpression xqe = xqc.createExpression(); XQSequence xqs = xqe.executeQuery("1,2,3,4"); xqs.next(); xqs.close(); try { xqs.getItem(); fail("A-XQS-1.2: closed sequence supports getItem()"); } catch (XQException e) { } xqe.close(); }
@Test public void testGetBoolean() throws XQException { XQExpression xqe = xqc.createExpression(); XQSequence xqs = xqe.executeQuery("xs:boolean('true')"); xqs.next(); xqs.getItem(); try { xqs.getBoolean(); fail("A-XQIA-1.4: SCROLLTYPE_FORWARD_ONLY sequence supports getting item twice()"); } catch (XQException e) { } xqe.close(); }