code: public final Position ensureContinuous(Position lastPosition) {
          double lon = this.lon;
          if (abs(lon - lastPosition.lon) > 180) {
              if (lastPosition.lon < 0)
                  lon -= 360;
              else
                  lon += 360;
              return new Position(lat, lon);
          } else
              return this;
  
      }
docs: normalize the lat lon values of this to ensure that no large longitude
  jumps are made from lastPosition (e.g. 179 to -180)
  
  @param lastPosition