@Test
public void testGetIntersectionAreaRate()  {

    logger.info("Running testGetIntersectionAreaRate ...");
    CoordinateReferenceSystem sourceCRS = org.geotools.referencing.crs.DefaultGeographicCRS.WGS84;
    // creates the world state polygon
    Polygon worldPolygon = createRectangularPolygonByCoords(-180,180,-90, 90, sourceCRS);
    // creates the Colorado state polygon
    Polygon coloradoPolygon = createRectangularPolygonByCoords(-102,-109,37, 41, sourceCRS);
    // calculates the estimated value
    double calculatedRate = IntersectionFeatureCollection.getIntersectionArea(worldPolygon, sourceCRS,coloradoPolygon , sourceCRS, true);
    // calculates the expected value
    double expectedRate = COLORADOAREA / WORLDAREA;
    
    // 0.01% error off the expected value
    assertEquals(0, (expectedRate - calculatedRate) / expectedRate, 0.01);
}