this feels funny to me. are you doing this in order to make it faster? if so, why not insert this check directly into equals?