PtsPolyline implements Polyline<T> { @Override public final List<Vect<T>> points() { return this.pts; } PtsPolyline(final Iterable<? extends Vect<T>> points); @Override final List<Vect<T>> points();  }
@Test public void buildPolylineWithPoints() { final RandomPoint<Object> pointa = new RandomPoint<>(); final RandomPoint<Object> pointb = new RandomPoint<>(); final RandomPoint<Object> pointc = new RandomPoint<>(); final RandomPoint<Object> pointd = new RandomPoint<>(); final Polyline<Object> poly = new PtsPolyline<>( Arrays.asList(pointa, pointb, pointc, pointd) ); final Iterator<Vect<Object>> points = poly.points().iterator(); MatcherAssert.assertThat( points.next(), Matchers.equalTo(pointa) ); MatcherAssert.assertThat( points.next(), Matchers.equalTo(pointb) ); MatcherAssert.assertThat( points.next(), Matchers.equalTo(pointc) ); MatcherAssert.assertThat( points.next(), Matchers.equalTo(pointd) ); }