File this under "Things I missed in Scripture."
Genesis 38 - Judah "turns aside" to Adullam and takes a Canaanite wife, the beginning of his sin.
1 Samuel 22:1 - David, descended from Judah, takes refuge from Saul in the cave of Adullam.
Not only is Judah redeemed from his sin in Adullam, his descendants find refuge in the place where he sinned.
Also, Judah's line is continued in an insane way. God kills his first two sons by this Canaanite, for their disobedience. Perez and Zerah are born of the union of Judah with his daughter-in-law, when Judah thought she was a prostitute.