Full mixed type equals() variant - in this case we genuinely assume that Point and ColorPoint can be genuinely equal when (explicitly) colorless ColorPoint is equals to (intrinsicly) colorless Point. This assume that every (extra) value component (color in ColorPoint) has default value (colorless color) making comparing subclass to superclass possible even when subclass have extra value components.
This solution is fully and unarguably and 100% Liskov Substitution Principle compliant.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|