A property equivalent to commutativity for infinite groups