Description
Currently the only way for a NodeStateDiff implementation to stop a compareAgainstBaseState() operation is to throw an undeclared exception. This is troublesome as using exceptions for flow control is bad practice and as in some cases short-cutting the comparison operation can notably improve performance by avoiding unnecessary work.
Thus I suggest that we add a boolean return value to the NodeStateDiff methods. By returning false, an implementation could signal the calling compareAgainstBaseState() method to stop the comparison. The return value should also be returned by the compareAgainstBaseState() method so that the caller can tell whether the comparison was stopped before completion.