@Test
public void shouldNotMoveUpperThanUsedVariables_MoveToMiddle() {

    final FieldConstraint[] fieldConstraints = new FieldConstraint[3];
    final SingleFieldConstraint top = new SingleFieldConstraint();
    top.setConstraintValueType(BaseSingleFieldConstraint.TYPE_VARIABLE);
    top.setValue("b");
    fieldConstraints[0] = top;
    final SingleFieldConstraint middle = new SingleFieldConstraint();
    middle.setConstraintValueType(BaseSingleFieldConstraint.TYPE_VARIABLE);
    middle.setValue("a");
    fieldConstraints[1] = middle;
    final SingleFieldConstraint bottom = new SingleFieldConstraint();
    bottom.setFieldBinding("a");
    fieldConstraints[2] = bottom;
    FieldConstraintArrayUtil.moveUp(2, fieldConstraints);
    FieldConstraintArrayUtil.moveUp(1, fieldConstraints);
    assertEquals(bottom, fieldConstraints[0]);
    assertEquals(top, fieldConstraints[1]);
    assertEquals(middle, fieldConstraints[2]);
}