if (!sourceConsumer.getOwner().getKey().equals(destinationConsumer.getOwner().getKey())) {
throw new BadRequestException(i18n.tr(
"Source and destination units must belong to the same organization"));
}
// test to ensure destination can use the pool
ValidationResult result = enforcer.preEntitlement(destinationConsumer,
entitlement.getPool(), 0, CallerType.BIND);
if (!result.isSuccessful()) {
throw new BadRequestException(i18n.tr(
"The entitlement cannot be utilized by the destination unit: ") +
messageTranslator.poolErrorToMessage(entitlement.getPool(),
result.getErrors().get(0)));
}
if (quantity.intValue() == entitlement.getQuantity()) {
unbind(id);
}
else {