GeoPolyLine extends GeoObject { @Nonnull public List<GeoLine> asLines() { final List<GeoLine> lines = new ArrayList<>(points.size() - 1); GeoPoint from = points.get(0); for (int i = 1; i < points.size(); ++i) { final GeoPoint to = points.get(i); lines.add(new GeoLine(from, to)); from = to; } assert lines.size() == (points.size() - 1); return lines; } GeoPolyLine(@Nonnull final List<GeoPoint> points); @SuppressWarnings({"ConstantConditions", "UnusedDeclaration"}) @Deprecated private  GeoPolyLine(); @Nonnull @Override GeoPoint getOrigin(); @Nonnull @Override GeoPoint getCenter(); @Nonnull GeoPoint getPointAtOffset(final double offsetInMeters); int size(); @Nonnull GeoPoint get(final int i); @Nonnull List<GeoLine> asLines(); @Nonnull GeoLine getLine(final int i); @Nonnull @Override GeoPolyLine translate(@Nonnull final GeoVector vector); @Nonnull @Override GeoPolyLine moveTo(@Nonnull final GeoPoint origin); double getLengthMeters(); @Override boolean canEqual(@Nonnull final Object obj); @Override boolean equals(@Nullable final Object obj); @Override int hashCode();  }
@Test public void testAsLines() { LOG.info("testAsLines"); final GeoPoint o = new GeoPoint(-0.5, 10.0); final GeoPoint x1 = new GeoPoint(0.5, 10.0); final GeoPoint x2 = new GeoPoint(1.5, 10.0); final GeoPolyLine poly = new GeoPolyLine(Lists.asList(o, x1, new GeoPoint[]{x2})); final List<GeoLine> lines = poly.asLines(); Assert.assertEquals(2, lines.size()); Assert.assertEquals(lines.get(0), new GeoLine(o, x1)); Assert.assertEquals(lines.get(1), new GeoLine(x1, x2)); }