Details
Description
This line:
MapContext highlightContext = new DefaultMapContext(DefaultGeographicCRS.WGS84);
can be replace to
MapContext highlightContext = new DefaultMapContext(context.getCoordinateReferenceSystem());
to avoid unnecessary transform.
The transform will cause issues if the map context CoordinateReferenceSystem can't be transform to DefaultGeographicCRS.WGS84.