public boolean equals(Object obj) { if (obj instanceof Dept == false) return false; if (this == obj) return true; Dept other = (Dept) obj; return new EqualsBuilder().append(getDeptId(), other.getDeptId()).isEquals(); }