if (entity == null) {
equal = false;
} else if (entity == this) {
equal = true;
} else {
Id idLeft = getId();
Id idRight = entity.getId();
if (idLeft != null && idRight != null) {
if (idLeft.size() == idRight.size()) {
for (String propertyCode : idLeft.getPropertyCodeList()) {
Object propertyLeft = idLeft.getProperty(propertyCode);
Object propertyRight = idRight
.getProperty(propertyCode);
if (!propertyLeft.equals(propertyRight)) {
equal = false;
break;
}
}
for (String neighborCode : idLeft.getNeighborCodeList()) {
IEntity neighborLeft = idLeft.getNeighbor(neighborCode);
IEntity neighborRight = idRight
.getNeighbor(neighborCode);
if (neighborLeft != null && neighborRight != null
&& !neighborLeft.equals(neighborRight)) {
equal = false;
break;