PolylineEncoder { public static List<CoordinatePoint> decode(EncodedPolylineBean polyline) { return decode(polyline.getPoints()); }  static EncodedPolylineBean createEncodings(double[] lat, double[] lon); static EncodedPolylineBean createEncodings(double[] lat, double[] lon,
      int level); static EncodedPolylineBean createEncodings(double[] lat, double[] lon,
      int offset, int length, int level); static EncodedPolylineBean createEncodings(
      Iterable<CoordinatePoint> points); static EncodedPolylineBean createEncodings(
      Iterable<CoordinatePoint> points, int level); static List<CoordinatePoint> decode(EncodedPolylineBean polyline); static List<CoordinatePoint> decode(String pointString); static String encodeSignedNumber(int num); static int decodeSignedNumber(String value); static int[] decodeSignedNumberWithIndex(String value, int index); static String encodeNumber(int num); static int decodeNumber(String value); static int[] decodeNumberWithIndex(String value, int index);  }
@Test public void testDecode() { String polyline = "mz{aHryriV???tE???jE??AlC???lF??AlF??AnF???fF???|F???P?N???lE???T?\\???xD???|@???nD???xB???L?zG???nG?V???jD??qAxC??i@vAKXGTABAJ?B?B??AfF?D@`A??BPBZBr@???d@@`B?V?d@???zBAf@Cb@E^AX??Ad@??AfB?|A??@~G???vF???zF??A`H??WzAUx@??]v@??GL??yAzCg@x@??GH_@b@??c@f@??mC~C??gBtBi@f@??ABMF??cAn@kAl@wE`C??_Aj@C@eAx@a@Z[T??YT]Vg@`@??OVKVGRI`@CVG~@??@fA???pC??@tE??@lB?zA?P??AbN???lL??@hK?vC???N???T??AzN???LAhF?T?fG???dH"; List<CoordinatePoint> decode = PolylineEncoder.decode(polyline); assertEquals(157, decode.size()); CoordinatePoint p = decode.get(0); assertEquals(47.661350000000006, p.getLat(), 1e-5); assertEquals(-122.32618000000001, p.getLon(), 1e-5); }