MarkerOptionsMapper implements Mapper<MarkerOptions, com.google.android.gms.maps.model.MarkerOptions> { @Override public com.google.android.gms.maps.model.MarkerOptions map(MarkerOptions input) { LatLng googleLatLng = AnyMapAdapter.adapt(input.getPosition()); return new com.google.android.gms.maps.model.MarkerOptions() .alpha(input.getAlpha()) .position(googleLatLng) .visible(input.isVisible()) .anchor( input.getAnchorU(), input.getAnchorV() ) .icon( ((BitmapDescriptorAdapter) input.getIcon()).wrappedDescriptor ) .zIndex(input.getZ()); }  @Override com.google.android.gms.maps.model.MarkerOptions map(MarkerOptions input);  }
@Test public void testMap() throws Exception { BitmapDescriptor bitmapDescriptor = mock(BitmapDescriptor.class); BitmapDescriptorAdapter descriptorAdapter = new BitmapDescriptorAdapter(bitmapDescriptor); MarkerOptionsMapper mapper = new MarkerOptionsMapper(); MarkerOptions input = new MarkerOptions() .alpha(0.5f) .anchor(0.5f, 0.5f) .icon(descriptorAdapter) .position(new LatLng(10, 10)) .visible(true); com.google.android.gms.maps.model.MarkerOptions output = mapper.map(input); assertEquals( input.getAlpha(), output.getAlpha(), 0 ); assertEquals( input.getAnchorU(), output.getAnchorU(), 0 ); assertEquals( input.getAnchorV(), output.getAnchorV(), 0 ); assertEquals( bitmapDescriptor, output.getIcon() ); TestUtil.assertEquals( input.getPosition(), output.getPosition() ); assertEquals( input.isVisible(), output.isVisible() ); }