public int getIndexByIdentifier(FactIdentifier factIdentifier, ExpressionIdentifier expressionIdentifier) {
        return IntStream.range(0, factMappings.size()).filter(index -> {
            FactMapping factMapping = factMappings.get(index);
            return Objects.equals(factMapping.getExpressionIdentifier(), expressionIdentifier) &&
                    Objects.equals(factMapping.getFactIdentifier(), factIdentifier);
        }).findFirst().orElseThrow(() -> new IllegalArgumentException(
                new StringBuilder().append("Impossible to find a FactMapping with factIdentifier '").append(factIdentifier.getName())
                        .append("' and expressionIdentifier '").append(expressionIdentifier.getName()).append("'").toString()));
    }
@Test
    public void getIndexByIdentifierTest() {
        FactMapping factMapping0 = modelDescriptor.addFactMapping(factIdentifier, expressionIdentifier);
        FactMapping factMapping1 = modelDescriptor.addFactMapping(factIdentifier2, expressionIdentifier);
        int indexToCheck = 0;
        int indexRetrieved = modelDescriptor.getIndexByIdentifier(factMapping0.getFactIdentifier(), expressionIdentifier);
        
        assertThat(indexRetrieved).isEqualTo(indexToCheck);
        
        indexToCheck = 1;
        indexRetrieved = modelDescriptor.getIndexByIdentifier(factMapping1.getFactIdentifier(), expressionIdentifier);
        
        assertThat(indexRetrieved).isEqualTo(indexToCheck);
    }