LPS-49364 Fallback logic - use the MasterLayoutSetBranch
LPS-49364 Switch the order - when layoutSetBranchId > 0 the userId isn't used at all
LPS-49364 SF - in this way it is more obvious we do not want to return null only valid layout revisions or exceptions
LPS-49448 move stub permission checkers out of portal-test

Remove circular dependency between portal-test and portal-impl by moving
these classes into portal-test-internal.
LPS-49411 Use password reset required instead of creation date. Basically a better fix for LEP-2961
LPS-49411 Source Formatting