AbstractScesimModel { public void removeFactMappingByIndex(int index) { clearDatas(scesimModelDescriptor.getFactMappingByIndex(index)); scesimModelDescriptor.removeFactMappingByIndex(index); }  abstract AbstractScesimModel<T> cloneModel(); abstract T addData(int index); List<T> getUnmodifiableData(); void removeDataByIndex(int index); void removeData(T toRemove); T getDataByIndex(int index); T addData(); void replaceData(int index, T newScesimData); T cloneData(int sourceIndex, int targetIndex); void clear(); void clearDatas(); void resetErrors(); ScesimModelDescriptor getScesimModelDescriptor(); void removeFactMappingByIndex(int index); void removeFactMapping(FactMapping toRemove);  }
@Test public void removeFactMappingByIndex() { assertEquals(FACT_MAPPINGS, abstractScesimModelSpy.scesimModelDescriptor.getFactMappings().size()); final FactMapping factMappingByIndex = abstractScesimModelSpy.scesimModelDescriptor.getFactMappingByIndex(2); abstractScesimModelSpy.removeFactMappingByIndex(2); verify(abstractScesimModelSpy, times(1)).clearDatas(eq(factMappingByIndex)); assertEquals(FACT_MAPPINGS - 1, abstractScesimModelSpy.scesimModelDescriptor.getFactMappings().size()); assertFalse(abstractScesimModelSpy.scesimModelDescriptor.getFactMappings().contains(factMappingByIndex)); }