Get a small paper bag or something similar that is lightproof a paper bag will not be suitable for strong HID lighting, and a plastic coated twist tie.

Select a plant that you would like to sex and choose a growing tip. Take the paper bag, place it over the top of the selected tip and seal with the twisty tie. Then, to simulate the flowering phase, simply remove the bag after the 12hr dark period, and replace when the 12hr day cycle ends.

After 7-14 days, the growth-tip you covered should start showing signs of its sex.

Caution should be taken when closing the bag too tightly around the branch.
A small opening should be left open to allow air exchange and prevent heat buildup. Black materials tend to heat up and the branch may suffer from excess heat, causing wilting.