Generate testing code of box intersection