@Test
  public void testMarkerAndPathAsEncodedPolyline() throws Exception {
    try (LocalTestServerContext sc = new LocalTestServerContext(IMAGE)) {
      StaticMapsRequest req = StaticMapsApi.newRequest(sc.context, new Size(WIDTH, HEIGHT));
      Markers markers = new Markers();
      markers.size(MarkersSize.small);
      markers.customIcon("http://not.a/real/url", CustomIconAnchor.bottomleft, 2);
      markers.color("blue");
      markers.label("A");
      markers.addLocation("Melbourne");
      markers.addLocation(SYDNEY);
      req.markers(markers);

      List<LatLng> points = new ArrayList<>();
      points.add(MELBOURNE);
      points.add(SYDNEY);
      EncodedPolyline path = new EncodedPolyline(points);
      req.path(path);

      req.await();

      sc.assertParamValue(
          "icon:http://not.a/real/url|anchor:bottomleft|scale:2|size:small|color:blue|label:A|Melbourne|-33.86880000,151.20930000",
          "markers");
      sc.assertParamValue("enc:" + MELBOURNE_TO_SYDNEY_ENCODED_POLYLINE, "path");
    }
  }
This encoded path matches the exact [MELBOURNE, SYDNEY] points.
src/test/java/com/google/maps/StaticMapsApiTest.java