Changed the equals method and used EqualsBuilder.