code: public static Double getMaxZ(Geometry geom) {
          if (geom != null) {
              return CoordinateUtils.zMinMax(geom.getCoordinates())[1];
          } else {
              return null;
          }
      }
docs: Returns the maximal z-value of the given geometry.
  
  @param geom Geometry
  @return The maximal z-value of the given geometry, or null if the geometry is null.