if (p == null) {
return false;
}
- if (this.isFlatLayer2()) {
- return true;
- }
- return this.nodeConnectors.contains(p);
+ return isFlatLayer2() || nodeConnectors.contains(p);
}
public boolean isMutualExclusive(Subnet otherSubnet) {
- if (this.networkAddress.getClass() != otherSubnet.networkAddress
- .getClass()) {
- return true;
- }
- if (this.isSubnetOf(otherSubnet.getNetworkAddress())) {
- return false;
- }
- if (otherSubnet.isSubnetOf(this.getNetworkAddress())) {
- return false;
- }
- return true;
+ return !(isSubnetOf(otherSubnet.getNetworkAddress()) || otherSubnet.isSubnetOf(getNetworkAddress()));
}
/**