PolygonOptionsMapper implements Mapper<PolygonOptions, com.google.android.gms.maps.model.PolygonOptions> { @Override public com.google.android.gms.maps.model.PolygonOptions map(PolygonOptions input) { List<LatLng> points = AnyMapAdapter.adaptList(com.car2go.maps.model.LatLng.class, input.getPoints()); return new com.google.android.gms.maps.model.PolygonOptions() .fillColor(input.getFillColor()) .strokeColor(input.getStrokeColor()) .strokeWidth(input.getStrokeWidth()) .addAll(points); }  @Override com.google.android.gms.maps.model.PolygonOptions map(PolygonOptions input);  }
@Test public void testMap() throws Exception { PolygonOptionsMapper mapper = new PolygonOptionsMapper(); PolygonOptions input = new PolygonOptions() .strokeColor(0xff0000) .fillColor(0x00ff00) .strokeWidth(10f) .add(new LatLng(10, 10)); com.google.android.gms.maps.model.PolygonOptions output = mapper.map(input); assertEquals( input.getStrokeColor(), output.getStrokeColor() ); assertEquals( input.getFillColor(), output.getFillColor() ); assertEquals( input.getStrokeWidth(), output.getStrokeWidth(), 0 ); assertEquals( 1, output.getPoints().size() ); TestUtil.assertEquals( input.getPoints().get(0), output.getPoints().get(0) ); }