try
{
final Element entry = element.getList().insert();
final FunctionContext context = new ModelElementFunctionContext( entry );
final FunctionResult fr = ExpressionLanguageParser.parse( "${ This.Index }" ).evaluate( context );
try
{
assertEquals( 0, fr.value() );
element.getList().insert();
assertEquals( 0, fr.value() );
element.getList().insert( 0 );
assertEquals( 1, fr.value() );
element.getList().moveDown( entry );
assertEquals( 2, fr.value() );
element.getList().remove( 0 );
assertEquals( 1, fr.value() );
element.getList().remove( 0 );
assertEquals( 0, fr.value() );
}
finally
{
fr.dispose();
}
}
finally
{
element.dispose();