if (cart1 == cart2)
return false;
if (cart1 instanceof ILinkableCart) {
ILinkableCart link = (ILinkableCart) cart1;
if (!link.isLinkable() || !link.canLinkWithCart(cart2))
return false;
}
if (cart2 instanceof ILinkableCart) {
ILinkableCart link = (ILinkableCart) cart2;
if (!link.isLinkable() || !link.canLinkWithCart(cart1))
return false;
}
if (areLinked(cart1, cart2))
return false;