In geotools you can find distance between two geometries using the distance function in Geometry class. There is a Point subclass of Geometry but no line segment subclass of Geometry. There is however LineSegment class which derives from LineString which is not subclass of Geometry class. I tried using JTS but it appears as JTS is only for Cartesian coordinate system.
Question: How to find shortest distance (in meters) between a LineSegment and a Point in WGS84 crs.
Please note: I know there are answers available on SO for doing this without using geotools. Since we are using geotools in our project and code maintainability is very important I want to do it in geotools.