Bloomreach A/B testing

can someone please help me in understanding how does all variants of A/B testing works in the background, on what parameters/attributes it differentiates users and presents different variants. I have some basic knowledge on it that it uses userhash value and jsession ID to present a variant randomly. Is there are any pseudo-code or algorithm or java class which handles the A/B testing functionality in bloomreach. We would also like to know if anyone had implemented A/B experiments through CDN.

your prompt responses will be appreciable. Thanks