throws DuplicateValueTrueReportGlobalAdvanceException,
DuplicateAdvanceAssignmentForOrderElementException {
model.addElement("element", 100);
model.addElementAt(order.getChildren().get(0), "element2", 50);
OrderLineGroup container = (OrderLineGroup) order.getChildren().get(0);
OrderLine element = null;
OrderLine element2 = null;
for (OrderElement each : container.getChildren()) {
if (each.getName().equals("")) {
element = (OrderLine) each;
} else if (each.getName().equals("element2")) {
element2 = (OrderLine) each;
}
}
model.unindent(element2);
addCriterionRequirement(container);
addDirectAdvanceAssignment(container);
addAnotherCriterionRequirement(element2);
addAnotherDirectAdvanceAssignment(element2);
addAnotherDifferentCriterionRequirement(order);
addAnotherDifferentDirectAdvanceAssignment(order);
model.move(element2, container);
assertThat(order.getDirectAdvanceAssignments().size(), equalTo(1));
assertNotNull(order.getDirectAdvanceAssignmentByType(advanceType3));
assertNotNull(order.getIndirectAdvanceAssignment(advanceType));
assertNotNull(order.getIndirectAdvanceAssignment(advanceType2));
assertThat(order.getCriterionRequirements().size(), equalTo(1));
assertDirectCriterion(order.getCriterionRequirements().iterator()
.next(), criterion3);
assertThat(container.getDirectAdvanceAssignments().size(), equalTo(1));
assertNotNull(container.getDirectAdvanceAssignmentByType(advanceType));
assertNotNull(container.getIndirectAdvanceAssignment(advanceType2));
assertNull(container.getIndirectAdvanceAssignment(advanceType3));
assertThat(container.getCriterionRequirements().size(), equalTo(2));
for (CriterionRequirement each : container.getCriterionRequirements()) {
if (each.getCriterion().isEquivalent(criterion3)) {
assertTrue(each instanceof IndirectCriterionRequirement);
} else if (each.getCriterion().isEquivalent(criterion)) {
assertTrue(each instanceof DirectCriterionRequirement);
} else {