Here is basic example how to make transformation and apply it on raster sources

/* Open the file with Image */

            WorldImageReader reader = new WorldImageReader(url);
            Operations operations = new Operations(null);
            GridCoverage2D coverage = (GridCoverage2D) reader.read(null);
            Envelope env = coverage.getEnvelope();

 /*
  * Construct WarpGrod Builder - assuming we are having some known vectors (MappedPositions)
  * that should define the source and target points
  * We also have to set the column size of controlling grid that is going to be generated
  * Within this grid there will be just approximative billiner interpolation used.
  */

            WarpGridBuilder gridBuilder = new TPSGridBuilder(vectors, 0.01, 0.01, env,
                    coverage.getGridGeometry().getGridToCRS().inverse());

   /* Get new transformation from builder */

            MathTransform trans = gridBuilder.getMathTransform();

   /* Make New reference System */

            CoordinateReferenceSystem gridCRS = new DefaultDerivedCRS("gridCRS",
                    new DefaultOperationMethod(trans), coverage.getCoordinateReferenceSystem(),
                    trans, DefaultCartesianCS.GENERIC_2D);

   /* Reproject the image */

            AbstractProcessor processor = AbstractProcessor.getInstance();
            coverage = coverage.geophysics(false);

            final ParameterValueGroup param = processor.getOperation("Resample").getParameters();

            param.parameter("Source").setValue(coverage);
            param.parameter("CoordinateReferenceSystem").setValue(gridCRS);
            param.parameter("InterpolationType").setValue("bilinear");

            GridCoverage2D projected = (GridCoverage2D) processor.doOperation(param);
            final RenderedImage image = projected.getRenderedImage();
            projected = projected.geophysics(false);
/* And show it*/

            projected.show();