Joseph had his life swinging as a pendulum, from evil events to better ones. But if not for the events of slavery and prison, would he be the Joseph that we know from Scriptures? So you never know what is really good or bad unless you wait for God to make it work for your good.