Pakistan and China have common threats and goals