We are currently computing YangInstanceIdentifier's hashCode eagerly during construction. This is not needed in most cases, because even though it is used for equals(), we rarely perform equality/hash-base lookups and most of the time we just examine the PathArguments.
Refactor the code to calculate the hashCode only when needed and update equals() methods to work on PathArguments only.