For more than 20 years, Australia tried to maintain good relations with both the United States and China.