hashCode and equals for ScalaElements