@Test
public void prepareSelection() {

  SeSelection seSelection = createSeSelection();
  // let's check if the result is as expected
  // (see createSelectionSelectionSelection to have a look at the expected values)
  // get the selection operation
  AbstractDefaultSelectionsRequest selectionOperation = seSelection.getSelectionOperation();
  // check common flags
  Assert.assertEquals(
      MultiSeRequestProcessing.FIRST_MATCH, selectionOperation.getMultiSeRequestProcessing());
  Assert.assertEquals(ChannelControl.KEEP_OPEN, selectionOperation.getChannelControl());
  // get the serequest set
  List<SeRequest> selectionSeRequests = selectionOperation.getSelectionSeRequests();
  Assert.assertEquals(2, selectionSeRequests.size());
  // get the two se requests
  Iterator<SeRequest> iterator = selectionSeRequests.iterator();
  SeRequest seRequest1 = iterator.next();
  SeRequest seRequest2 = iterator.next();
  // check selectors
  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());
  // that's all!
}