@Test
	public void forNTimesWithIndex() {
		DataFactory factory = new DataFactory();
		Context context = new Context();
		For f = factory.createFor();
		Function func = factory.createFunction();
		
		IVPValue startingValue = factory.createIVPNumber();
		startingValue.setValueType(IVPValue.INTEGER_TYPE);
		context.addInt(startingValue.getUniqueID(), 0);

		IVPValue one = factory.createIVPNumber();
		one.setValueType(IVPValue.INTEGER_TYPE);
		context.addInt(one.getUniqueID(), 1);

		IVPValue indexValue = factory.createIVPNumber();
		indexValue.setValueType(IVPValue.INTEGER_TYPE);
		context.addInt(indexValue.getUniqueID(), 1);

		IVPValue n_times = factory.createIVPNumber();
		n_times.setValueType(IVPValue.INTEGER_TYPE);
		context.addInt(n_times.getUniqueID(), 5);

		IVPVariable v = factory.createIVPVariable();
		v.setVariableType(IVPValue.INTEGER_TYPE);
		v.setValueID(startingValue.getUniqueID());

		IVPVariable indexVar = factory.createIVPVariable();
		indexVar.setVariableType(IVPValue.INTEGER_TYPE);
		indexVar.setValueID(indexValue.getUniqueID());

		Addition add = factory.createAddition();
		add.setExpressionA(v.getUniqueID());
		add.setExpressionB(one.getUniqueID());

		AttributionLine attLine = factory.createAttributionLine();
		attLine.setVariable(v.getUniqueID());
		attLine.setExpression(add.getUniqueID());

		HashMap map = new HashMap();
		map.put(startingValue.getUniqueID(), startingValue);
		map.put(one.getUniqueID(), one);
		map.put(indexValue.getUniqueID(), indexValue);
		map.put(v.getUniqueID(), v);
		map.put(indexVar.getUniqueID(), indexVar);
		map.put(add.getUniqueID(), add);
		map.put(attLine.getUniqueID(), attLine);
		map.put(n_times.getUniqueID(), n_times);
		map.put(func.getUniqueID(), func);
		context.setFunctionID(func.getUniqueID());

		f.setExecutionMethod(For.FOR_N_TIMES_WITH_INDEX);
		f.setIndex(indexVar.getUniqueID());
		f.setUpperBound(n_times.getUniqueID());
		f.addChild(attLine.getUniqueID());
		f.evaluate(context, map, factory);

		IVPNumber result = (IVPNumber) v.evaluate(context, map, factory);
		assertTrue(context.getInt(result.getUniqueID()) == 5);
		result = (IVPNumber) indexVar.evaluate(context, map, factory);
		assertTrue(context.getInt(result.getUniqueID()) == 6);
	}