SeSelection { public int prepareSelection( AbstractSeSelectionRequest<? extends AbstractApduCommandBuilder> seSelectionRequest) { if (logger.isTraceEnabled()) { logger.trace("SELECTORREQUEST = {}", seSelectionRequest.getSelectionRequest()); } seSelectionRequests.add(seSelectionRequest); return seSelectionRequests.size() - 1; } SeSelection(MultiSeRequestProcessing multiSeRequestProcessing);  SeSelection(); int prepareSelection(
      AbstractSeSelectionRequest<? extends AbstractApduCommandBuilder> seSelectionRequest); final void prepareReleaseSeChannel(); SelectionsResult processDefaultSelection(
      AbstractDefaultSelectionsResponse defaultSelectionsResponse); SelectionsResult processExplicitSelection(SeReader seReader); AbstractDefaultSelectionsRequest getSelectionOperation();  }
@Test public void prepareSelection() { SeSelection seSelection = createSeSelection(); AbstractDefaultSelectionsRequest selectionOperation = seSelection.getSelectionOperation(); Assert.assertEquals( MultiSeRequestProcessing.FIRST_MATCH, selectionOperation.getMultiSeRequestProcessing()); Assert.assertEquals(ChannelControl.KEEP_OPEN, selectionOperation.getChannelControl()); List<SeRequest> selectionSeRequests = selectionOperation.getSelectionSeRequests(); Assert.assertEquals(2, selectionSeRequests.size()); Iterator<SeRequest> iterator = selectionSeRequests.iterator(); SeRequest seRequest1 = iterator.next(); SeRequest seRequest2 = iterator.next(); Assert.assertEquals( "AABBCCDDEE", ByteArrayUtil.toHex(seRequest1.getSeSelector().getAidSelector().getAidToSelect())); Assert.assertEquals( "1122334455", ByteArrayUtil.toHex(seRequest2.getSeSelector().getAidSelector().getAidToSelect())); Assert.assertEquals( SeSelector.AidSelector.FileOccurrence.FIRST, seRequest1.getSeSelector().getAidSelector().getFileOccurrence()); Assert.assertEquals( SeSelector.AidSelector.FileOccurrence.NEXT, seRequest2.getSeSelector().getAidSelector().getFileOccurrence()); Assert.assertEquals( SeSelector.AidSelector.FileControlInformation.FCI, seRequest1.getSeSelector().getAidSelector().getFileControlInformation()); Assert.assertEquals( SeSelector.AidSelector.FileControlInformation.FCP, seRequest2.getSeSelector().getAidSelector().getFileControlInformation()); Assert.assertNull( seRequest1.getSeSelector().getAidSelector().getSuccessfulSelectionStatusCodes()); Assert.assertEquals( 1, seRequest2.getSeSelector().getAidSelector().getSuccessfulSelectionStatusCodes().size()); Assert.assertEquals( 0x6283, seRequest2 .getSeSelector() .getAidSelector() .getSuccessfulSelectionStatusCodes() .toArray()[0]); Assert.assertNull(seRequest1.getSeSelector().getAtrFilter()); Assert.assertEquals(".*", seRequest2.getSeSelector().getAtrFilter().getAtrRegex()); Assert.assertEquals(2, seRequest1.getApduRequests().size()); Assert.assertEquals(0, seRequest2.getApduRequests().size()); List<ApduRequest> apduRequests = seRequest1.getApduRequests(); Assert.assertArrayEquals(apduRequests.get(0).getBytes(), ByteArrayUtil.fromHex("001122334455")); Assert.assertArrayEquals(apduRequests.get(1).getBytes(), ByteArrayUtil.fromHex("66778899AABB")); Assert.assertFalse(apduRequests.get(0).isCase4()); Assert.assertTrue(apduRequests.get(1).isCase4()); }