code: private void computeMaxDistance() {
          HashSet<Coordinate> coordinatesA = new HashSet<Coordinate>(Arrays.asList(geomA.convexHull().getCoordinates()));
          Geometry fullHull = geomA.getFactory().createGeometryCollection(new Geometry[]{geomA, geomB}).convexHull();
          maxDistanceFilter = new MaxDistanceFilter(coordinatesA);
          fullHull.apply(maxDistanceFilter);
      }
docs: Compute the max distance