Let H be a complex Hilbert space and let C be a conjugacy class of finite rank self-adjoint operators on H with respect to the action of unitary operators. We suppose that C is formed by operators of rank k and for every A ∈ C the dimensions of distinct maximal eigenspaces are distinct. Under the assumption that dim H ≥ 4k we establish that every bijective transformation f of C preserving the commutativity in both directions is induced by a unitary or anti-unitary operator, i.e. there is a unitary or anti-unitary operator U such that f (A) = U AU * for every A ∈ C. A simple example shows that the condition concerning the dimensions of maximal eigenspaces cannot be omitted.