A characterization of normal operators