code: public Polygon toPolygon(PolygonOptions polygon, boolean hasZ, boolean hasM) {
          return toPolygon(polygon.getPoints(), polygon.getHoles(), hasZ, hasM);
      }
docs: Convert a {@link com.google.android.gms.maps.model.Polygon} to a
  {@link Polygon}
  
  @param polygon polygon options
  @param hasZ    has z flag
  @param hasM    has m flag
  @return polygon