Long time behavior of nonlinear wave equations and the soliton resolution conjecture