Acts 23.11: The following night the Lord stood by him and said, “Take courage, for as you have testified to the facts about me in Jerusalem, so you must testify also in Rome.” (ESV)
The Apostle Paul had been warned prophetically by Agabus in Acts 21.11 not to go to Jerusalem. The prophecy said that Paul would in effect be imprisoned. This did happen. But Paul was previously persuaded that he should go to Jerusalem, and notwithstanding all of the well meaning voices telling him not to go, Paul went up to Jerusalem and was arrested. This led to him giving an account of himself to the chief priests and council. This meeting was unruly and he was struck on the face and Roman soldiers had to bring things under control.
But Paul would not be intimidated. He believed that God had wanted him to go to Jerusalem and he had been obedient, regardless of the uncertainty of all of the abuse and imprisonment. In verse 11 above, Jesus appeared to Paul to encourage him and strengthen his resolve to stay on this path of obedience. Jesus revealed that not only was it the right thing for Paul to be in Jerusalem, but also he would be sent to Rome to testify about him.
If Paul had given in to the majority opinion of his friends and the opposition produced by his circumstances, he would not have correctly and expeditiously carried out Jesus’ plan for his life.

