@Test
    public void testBoxRayCollision() {
        BoundingBox box = new BoundingBox(Vector3f.ZERO, 1, 1, 1);
        Ray ray = new Ray(Vector3f.ZERO, Vector3f.UNIT_Z);
        
        // XXX: seems incorrect, ray inside box should only generate
        // one result...
        checkCollision(box, ray, 2);
        
        ray.setOrigin(new Vector3f(0, 0, -5));
        checkCollision(box, ray, 2);
        
        // XXX: is this right? the ray origin is on the box's side.
        ray.setOrigin(new Vector3f(0, 0, 2f));
        checkCollision(box, ray, 0);
        
        ray.setOrigin(new Vector3f(0, 0, -2f));
        checkCollision(box, ray, 2);
        
        // parallel to the edge, touching the side
        ray.setOrigin(new Vector3f(0, 1f, -2f));
        checkCollision(box, ray, 2);
        
        // still parallel, but not touching the side
        ray.setOrigin(new Vector3f(0, 1f + FastMath.ZERO_TOLERANCE, -2f));
        checkCollision(box, ray, 0);
    }
Tests collision detection between bounding volumes.

@author Kirill Vainer
jme3-core/src/test/java/com/jme3/collision/BoundingCollisionTest.java