for(OrderAuthorizationType type : authorizations) {
if(listContainsAuthorizationType(existingAuthorizations, type)) {
duplicated.add(type);
}
else {
ProfileOrderAuthorization orderAuthorization =
createProfileOrderAuthorization(order, profile);
orderAuthorization.setAuthorizationType(type);
profileOrderAuthorizationList.add(orderAuthorization);
planningState.addOrderAuthorization(orderAuthorization);
}
}
return duplicated.isEmpty()? null : duplicated;