Added a hasSameCode() method.