@Override public boolean equals(Object obj) { // Since this can not be null if (!(obj instanceof Verse)) { return false; } Verse that = (Verse) obj; // The real tests return this.ordinal == that.ordinal && this.v11n.equals(that.v11n) && bothNullOrEqual(this.subIdentifier, that.subIdentifier); }