code: public Geometry execute(Geometry geometry) {
  		if (geometry == null) {
  			return null;
  		}
  		if (geometry instanceof LinearRing) {
  			if (coordIndex <= 0) {
  				coordIndex = 0;
  			} else if (coordIndex > geometry.getNumPoints() - 2) {
  				coordIndex = geometry.getNumPoints() - 2;
  			}
  			Coordinate[] coordinates = new Coordinate[geometry.getNumPoints()];
  			for (int i = 0; i < coordinates.length; i++) {
  				Coordinate coordinate = geometry.getCoordinates()[i];
  				if (i == coordIndex) {
  					coordinates[i] = new Coordinate(coordinate.getX() + translateX, coordinate.getY() + translateY);
  				} else if (i == geometry.getNumPoints() - 1) {
  					coordinates[i] = coordinates[0];
  				} else {
  					coordinates[i] = coordinate;
  				}
  			}
  			return geometry.getGeometryFactory().createLinearRing(coordinates);
  		} else if (geometry instanceof LineString) {
  			if (coordIndex <= 0) {
  				coordIndex = 0;
  			} else if (coordIndex > geometry.getNumPoints() - 1) {
  				coordIndex = geometry.getNumPoints() - 1;
  			}
  			Coordinate[] coordinates = new Coordinate[geometry.getNumPoints()];
  			for (int i = 0; i < coordinates.length; i++) {
  				Coordinate coordinate = geometry.getCoordinates()[i];
  				if (i == coordIndex) {
  					coordinates[i] = new Coordinate(coordinate.getX() + translateX, coordinate.getY() + translateY);
  				} else {
  					coordinates[i] = geometry.getCoordinates()[i];
  				}
  			}
  			return geometry.getGeometryFactory().createLineString(coordinates);
  		}
  		return null;
  	}
docs: Execute the operation!
  
  @return Returns a new geometry. If the given geometry is null, or the given geometry is not a {@link LineString}
  or {@link LinearRing}, then null is returned.