Matthews opens his version of the Gospel story with the lineage of Jesus from Abraham. Is his time this would have been impossible to know without the Old Testament at ready to reference and an intense knowledge of it. OR, the Holy Spirit worked through Matthew to show him the lineage of Christ. This confirms that God has kept His promises to Abraham and all those who followed in his footsteps. Knowing this, we should expect God to keep the promises made in the new and the old testament. He will return and He is the Almighty.
Joseph has the choice as we all know to end his relationship with Mary. But the Divine stopped this from happening. Joseph knew the son was not his, but of God. Anything of God we must cherish and respect to the utmost. God's wishes and plans are above anything we as men can dream to have. There is little we can do to get in the way of God's plan, but we can aid the Lord in growing His kingdom. Do not sit on your laurels in sin. Embrace the freedom given us by the Lord and fail not in your prayer to repent of our failures to the Old Law. Open your heart to the Lord as Joseph and Mary did to receive Christ into their lives. Do this for Him and for your soul.