Deciphering the Rules for Roth 401(k)-to-Roth IRA Rollovers

More and more 401(k) plans are making Roth employee contributions available, and employees leaving their jobs often want to roll over Roth 401(k) funds to a Roth IRA. What tax rules apply to distributions of amounts rolled over? Warning: The rules are complicated because they involve two five-year holding periods, one for the Roth 401(k) distribution and the other for the Roth IRA distribution.