@Test
public void testAddPDoubleOutputParameterOutputParameter() {

	assertNotNull(this.bounds);
	MapPolylineGridSet<MapPolyline> test = new MapPolylineGridSet<>(100,100,this.bounds);
       test.addAll(this.reference);
       assertEquals(this.reference.size(), test.size());
       OutputParameter<MapPolyline> first = new OutputParameter<>();
       OutputParameter<MapPolyline> second = new OutputParameter<>();
       MapPolyline polyline;
       Point2d p1, p2;
       first.clear();
       second.clear();
       polyline = new MapPolyline();
       p1 = this.reference.get(0).getPointAt(this.reference.get(0).getPointCount()-1);
       p2 = new Point2d(
       		this.bounds.getMinX() + getRandom().nextDouble() * this.bounds.getWidth(),
       		this.bounds.getMinY() + getRandom().nextDouble() * this.bounds.getHeight());
       polyline.addPoint(p1.getX(), p1.getY());
       polyline.addPoint(p2.getX(), p2.getY());
       assertTrue(test.add(polyline, 0.5, first, second));
       assertConnected(polyline, first.get(), true);
       assertConnected(polyline, second.get(), false);
       first.clear();
       second.clear();
       polyline = new MapPolyline();
       p1 = new Point2d(
       		this.bounds.getMinX() + getRandom().nextDouble() * this.bounds.getWidth(),
       		this.bounds.getMinY() + getRandom().nextDouble() * this.bounds.getHeight());
       p2 = this.reference.get(1).getPointAt(this.reference.get(1).getPointCount()-1);
       polyline.addPoint(p1.getX(), p1.getY());
       polyline.addPoint(p2.getX(), p2.getY());
       assertTrue(test.add(polyline, 0.5, first, second));
       assertConnected(polyline, first.get(), true);
       assertConnected(polyline, second.get(), false);
       first.clear();
       second.clear();
       polyline = new MapPolyline();
       p1 = this.reference.get(2).getPointAt(this.reference.get(2).getPointCount()-1);
       p2 = this.reference.get(3).getPointAt(this.reference.get(3).getPointCount()-1);
       polyline.addPoint(p1.getX(), p1.getY());
       polyline.addPoint(p2.getX(), p2.getY());
       assertTrue(test.add(polyline, 0.5, first, second));
       assertConnected(polyline, first.get(), true);
       assertConnected(polyline, second.get(), false);
       first.clear();
       second.clear();
       polyline = new MapPolyline();
       p1 = new Point2d(
       		this.bounds.getMinX() + getRandom().nextDouble() * this.bounds.getWidth(),
       		this.bounds.getMinY() + getRandom().nextDouble() * this.bounds.getHeight());
       p2 = new Point2d(
       		this.bounds.getMinX() + getRandom().nextDouble() * this.bounds.getWidth(),
       		this.bounds.getMinY() + getRandom().nextDouble() * this.bounds.getHeight());
       polyline.addPoint(p1.getX(), p1.getY());
       polyline.addPoint(p2.getX(), p2.getY());
       assertTrue(test.add(polyline, 0.5, first, second));
       assertConnected(polyline, first.get(), true);
       assertConnected(polyline, second.get(), false);
}