Can the U.S. and China Avoid the Thucydides Trap?

The “Thucydides trap” refers to the theory that when a rising power threatens a ruling power, the result is often war. Are the U.S. and China headed there?