What am I doing wrong here?
@Override
public int hashCode()
{
HashCodeBuilder hashCodeBuilder = new HashCodeBuilder();
hashCodeBuilder.append(this.getId()).append(this.getDocFamilyUuid())
.append(this.getCorrelationId());
return hashCodeBuilder.hashCode();
}
This is how I create an object in groovy. Fields are set to static constants.
DocInfo docInfo = new DocInfo(id:DOC_ID, correlationId: CORRELATION_ID, docFamilyUuid: DOC_FAMILY_UUID)
And I'm trying to argue
assert docInfo.hashCode() ==
new DocInfo([id:DOC_ID,
correlationId: CORRELATION_ID,
docFamilyUuid:DOC_FAMILY_UUID]).hashCode()
source
share