ScesimModelDescriptor { public FactMapping addFactMapping(int index, FactMapping toClone) { FactMapping toReturn = toClone.cloneFactMapping(); factMappings.add(index, toReturn); return toReturn; }  List<FactMapping> getUnmodifiableFactMappings(); Set<FactIdentifier> getFactIdentifiers(); List<FactMapping> getFactMappings(); void moveFactMapping(int oldIndex, int newIndex); FactMapping getFactMappingByIndex(int index); int getIndexByIdentifier(FactIdentifier factIdentifier, ExpressionIdentifier expressionIdentifier); List<FactMapping> getFactMappingsByFactName(String factName); Optional<FactMapping> getFactMapping(FactIdentifier factIdentifier, ExpressionIdentifier ei); FactMapping addFactMapping(int index, FactMapping toClone); FactMapping addFactMapping(FactIdentifier factIdentifier, ExpressionIdentifier expressionIdentifier); FactMapping addFactMapping(String factAlias, FactIdentifier factIdentifier, ExpressionIdentifier expressionIdentifier); FactMapping addFactMapping(int index, FactIdentifier factIdentifier, ExpressionIdentifier expressionIdentifier); FactMapping addFactMapping(int index, String factAlias, FactIdentifier factIdentifier, ExpressionIdentifier expressionIdentifier); void clear();  }
@Test public void addFactMappingByIndexAndFactMapping() { FactMapping toClone = new FactMapping(); toClone.setFactAlias("ALIAS"); toClone.setExpressionAlias("EXPRESSION_ALIAS"); final FactMapping cloned = scesimModelDescriptor.addFactMapping(0, toClone); assertEquals(toClone.getFactAlias(), cloned.getFactAlias()); assertEquals(toClone.getExpressionAlias(), cloned.getExpressionAlias()); }
@Test public void addFactMappingByFactIdentifierAndExpressionIdentifier() { scesimModelDescriptor.addFactMapping(factIdentifier, expressionIdentifier); }
@Test(expected = IllegalArgumentException.class) public void addFactMappingByFactIdentifierAndExpressionIdentifierFail() { scesimModelDescriptor.addFactMapping(factIdentifier, expressionIdentifier); scesimModelDescriptor.addFactMapping(factIdentifier, expressionIdentifier); }
@Test public void addFactMappingByIndexAndFactIdentifierAndExpressionIdentifier() { scesimModelDescriptor.addFactMapping(0, factIdentifier, expressionIdentifier); }
@Test(expected = IllegalArgumentException.class) public void addFactMappingByIndexAndFactIdentifierAndExpressionIdentifierFail() { scesimModelDescriptor.addFactMapping(1, factIdentifier, expressionIdentifier); }