SelectionsResult { SelectionsResult() {} SelectionsResult(); AbstractMatchingSe getActiveMatchingSe(); Map<Integer, AbstractMatchingSe> getMatchingSelections(); AbstractMatchingSe getMatchingSe(int selectionIndex); boolean hasActiveSelection(); boolean hasSelectionMatched(int selectionIndex); int getActiveSelectionIndex();  }
@Test public void testSelectionsResult() { SelectionsResult selectionsResult = new SelectionsResult(); ApduResponse fci1 = new ApduResponse(ByteArrayUtil.fromHex(FCI1), null); SelectionStatus selectionStatus1 = new SelectionStatus(null, fci1, true); SeResponse seResponse1 = new SeResponse(true, false, selectionStatus1, null); ApduResponse fci2 = new ApduResponse(ByteArrayUtil.fromHex(FCI2), null); SelectionStatus selectionStatus2 = new SelectionStatus(null, fci2, true); SeResponse seResponse2 = new SeResponse(true, false, selectionStatus2, null); TestMatchingSe testMatchingSe1 = new TestMatchingSe(seResponse1); TestMatchingSe testMatchingSe2 = new TestMatchingSe(seResponse2); selectionsResult.addMatchingSe(0, testMatchingSe1, false); selectionsResult.addMatchingSe(2, testMatchingSe2, true); assertThat(selectionsResult.hasActiveSelection()).isTrue(); AbstractMatchingSe activeMatchingSe = selectionsResult.getActiveMatchingSe(); assertThat(activeMatchingSe).isEqualTo(testMatchingSe2); assertThat(selectionsResult.getActiveSelectionIndex()).isEqualTo(2); assertThat(selectionsResult.getMatchingSe(0)).isEqualTo(testMatchingSe1); assertThat(selectionsResult.getMatchingSe(2)).isEqualTo(testMatchingSe2); assertThat(selectionsResult.hasSelectionMatched(0)).isTrue(); assertThat(selectionsResult.hasSelectionMatched(1)).isFalse(); assertThat(selectionsResult.hasSelectionMatched(2)).isTrue(); Map<Integer, AbstractMatchingSe> matchingSelections = selectionsResult.getMatchingSelections(); assertThat(matchingSelections.get(0)).isEqualTo(testMatchingSe1); assertThat(matchingSelections.get(1)).isEqualTo(null); assertThat(matchingSelections.get(2)).isEqualTo(testMatchingSe2); }