@Test
    public void testBoxTriangleCollision() {
        BoundingBox box = new BoundingBox(Vector3f.ZERO, 1, 1, 1);
        Geometry geom = new Geometry("geom", new Quad(1, 1));
        checkCollision(box, geom, 2); // Both triangles intersect
        
        // The box touches the edges of the triangles.
        box.setCenter(new Vector3f(-1f, 0, 0));
        checkCollision(box, geom, 2);
        
        // Move it slightly farther.
        box.setCenter(new Vector3f(-1f - FastMath.ZERO_TOLERANCE, 0, 0));
        checkCollision(box, geom, 0);
        
        // Parallel triangle / box side, touching
        box.setCenter(new Vector3f(0, 0, -1f));
        checkCollision(box, geom, 2);
        
        // Not touching
        box.setCenter(new Vector3f(0, 0, -1f - FastMath.ZERO_TOLERANCE));
        checkCollision(box, geom, 0);
        
        // Test collisions only against one of the triangles
        box.setCenter(new Vector3f(-1f, 1.5f, 0f));
        checkCollision(box, geom, 1);
        
        box.setCenter(new Vector3f(1.5f, -1f, 0f));
        checkCollision(box, geom, 1);
    }
Tests collision detection between bounding volumes.

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