@Test
  public void testOverlaps() throws NoSuchIdentifierException, ProcessException {

    GeometryFactory fact = new GeometryFactory();

    // Inputs first
    final LinearRing ring =
        fact.createLinearRing(
            new Coordinate[] {
              new Coordinate(0.0, 0.0),
              new Coordinate(0.0, 10.0),
              new Coordinate(5.0, 10.0),
              new Coordinate(5.0, 0.0),
              new Coordinate(0.0, 0.0)
            });

    final Geometry geom1 = fact.createPolygon(ring, null);

    final LinearRing ring2 =
        fact.createLinearRing(
            new Coordinate[] {
              new Coordinate(-5.0, 0.0),
              new Coordinate(-5.0, 10.0),
              new Coordinate(2.0, 10.0),
              new Coordinate(2.0, 0.0),
              new Coordinate(-5.0, 0.0)
            });

    final Geometry geom2 = fact.createPolygon(ring2, null);
    // Process
    final ProcessDescriptor desc = ProcessFinder.getProcessDescriptor("jts", "overlaps");

    final ParameterValueGroup in = desc.getInputDescriptor().createValue();
    in.parameter("geom1").setValue(geom1);
    in.parameter("geom2").setValue(geom2);
    final org.geotoolkit.process.Process proc = desc.createProcess(in);

    // result
    final Boolean result = (Boolean) proc.call().parameter("result").getValue();

    final Boolean expected = geom1.overlaps(geom2);

    assertTrue(expected.equals(result));
  }
  @Test
  public void testOverlapsCRS() throws NoSuchIdentifierException, ProcessException {

    GeometryFactory fact = new GeometryFactory();

    // Inputs first
    final LinearRing ring =
        fact.createLinearRing(
            new Coordinate[] {
              new Coordinate(0.0, 0.0),
              new Coordinate(0.0, 10.0),
              new Coordinate(5.0, 10.0),
              new Coordinate(5.0, 0.0),
              new Coordinate(0.0, 0.0)
            });

    final Geometry geom1 = fact.createPolygon(ring, null);

    final LinearRing ring2 =
        fact.createLinearRing(
            new Coordinate[] {
              new Coordinate(-5.0, 0.0),
              new Coordinate(-5.0, 10.0),
              new Coordinate(2.0, 10.0),
              new Coordinate(2.0, 0.0),
              new Coordinate(-5.0, 0.0)
            });

    Geometry geom2 = fact.createPolygon(ring2, null);

    CoordinateReferenceSystem crs1 = null;
    try {
      crs1 = CRS.decode("EPSG:4326");
      JTS.setCRS(geom1, crs1);
    } catch (FactoryException ex) {
      Logger.getLogger(UnionProcess.class.getName()).log(Level.SEVERE, null, ex);
    }

    CoordinateReferenceSystem crs2 = null;
    try {
      crs2 = CRS.decode("EPSG:4326");
      JTS.setCRS(geom2, crs2);
    } catch (FactoryException ex) {
      Logger.getLogger(UnionProcess.class.getName()).log(Level.SEVERE, null, ex);
    }

    // Process
    final ProcessDescriptor desc = ProcessFinder.getProcessDescriptor("jts", "overlaps");

    final ParameterValueGroup in = desc.getInputDescriptor().createValue();
    in.parameter("geom1").setValue(geom1);
    in.parameter("geom2").setValue(geom2);
    final org.geotoolkit.process.Process proc = desc.createProcess(in);

    // result
    final Boolean result = (Boolean) proc.call().parameter("result").getValue();

    MathTransform mt = null;
    try {
      mt = CRS.findMathTransform(crs2, crs1);
      geom2 = JTS.transform(geom2, mt);
    } catch (FactoryException ex) {
      Logger.getLogger(UnionProcess.class.getName()).log(Level.SEVERE, null, ex);
    } catch (TransformException ex) {
      Logger.getLogger(UnionProcess.class.getName()).log(Level.SEVERE, null, ex);
    }

    final Boolean expected = geom1.overlaps(geom2);

    assertTrue(expected.equals(result));
  }