public void beforeAdd(CurricularPeriod child, CurricularPeriod parent) {
public void beforeAdd(CurricularPeriod parent, CurricularPeriod child) {
        public void beforeAdd(CurricularPeriod child, CurricularPeriod parent) {            if (child.getPeriodType().getWeight() >= parent.getPeriodType().getWeight()) {                throw new DomainException("error.childTypeGreaterThanParentType");            }            float childsWeight = child.getPeriodType().getWeight();            for (CurricularPeriod period : parent.getChilds()) {                childsWeight += period.getPeriodType().getWeight();            }            if (childsWeight > parent.getPeriodType().getWeight()) {                throw new DomainException("error.childWeightOutOfLimit");            }            // re-order childs            Integer order = child.getOrder();            if (order == null) {                child.setOrder(parent.getChildsCount() + 1);            } else {                if (parent.getChildByOrder(order) != null) {                    throw new DomainException("error.childAlreadyExists");                }            }        }