### Question:
WebHelper { public static String encodePolyline(PointList poly) { if (poly.isEmpty()) return ""; return encodePolyline(poly, poly.is3D()); }  static String encodeURL(String str); static PointList decodePolyline(String encoded, int initCap, boolean is3D); static String encodePolyline(PointList poly); static String encodePolyline(PointList poly, boolean includeElevation); static String readString(InputStream inputStream);  }### Answer:
@Test public void testEncode() throws Exception { assertEquals("_p~iF~ps|U", WebHelper.encodePolyline( Helper.createPointList(38.5, -120.2))); assertEquals("_p~iF~ps|U_ulLnnqC_mqNvxq`@", WebHelper.encodePolyline( Helper.createPointList(38.5, -120.2, 40.7, -120.95, 43.252, -126.453))); }
@Test public void testEncode3D() throws Exception { assertEquals("_p~iF~ps|Uo}@", WebHelper.encodePolyline(Helper.createPointList3D(38.5, -120.2, 10))); assertEquals("_p~iF~ps|Uo}@_ulLnnqC_anF_mqNvxq`@?", WebHelper.encodePolyline( Helper.createPointList3D(38.5, -120.2, 10, 40.7, -120.95, 1234, 43.252, -126.453, 1234))); }