A restriction on centralizers in finite groups