public boolean equals(Object anotherTelephoneNumberPK) { if (anotherTelephoneNumberPK.getClass() != TelephoneNumberPK.class) { return false; } TelephoneNumberPK telephoneNumberPK = (TelephoneNumberPK) anotherTelephoneNumberPK; return (telephoneNumberPK.getAreaCode().equals(getAreaCode()) && telephoneNumberPK.getNumber().equals(getNumber()) && telephoneNumberPK.getType().equals(getType())); }