### Question:
LocationLayerController { void setRenderMode(@RenderMode.Mode int renderMode) { if (this.renderMode == renderMode) { return; } this.renderMode = renderMode; styleBitmaps(options); determineIconsSource(options); if (!isHidden) { show(); } internalRenderModeChangedListener.onRenderModeChanged(renderMode); } LocationLayerController(MapboxMap mapboxMap, Style style,
                          LayerSourceProvider layerSourceProvider,
                          LayerFeatureProvider featureProvider,
                          LayerBitmapProvider bitmapProvider,
                          @NonNull LocationComponentOptions options,
                          @NonNull OnRenderModeChangedListener internalRenderModeChangedListener,
                          @NonNull OnIndicatorPositionChangedListener internalIndicatorPositionChangedListener,
                          boolean useSpecializedLocationLayer);   }### Answer:
@Test public void renderModeChanged_doNotNotifyAboutDuplicates_NORMAL() { OnRenderModeChangedListener internalRenderModeChangedListener = mock(OnRenderModeChangedListener.class); OnIndicatorPositionChangedListener internalIndicatorPositionChangedListener = mock(OnIndicatorPositionChangedListener.class); LayerSourceProvider sourceProvider = buildLayerProvider(); GeoJsonSource locationSource = mock(GeoJsonSource.class); when(sourceProvider.generateSource(any(Feature.class))).thenReturn(locationSource); LayerBitmapProvider bitmapProvider = mock(LayerBitmapProvider.class); LocationComponentOptions options = mock(LocationComponentOptions.class); LocationLayerController controller = new LocationLayerController(mapboxMap, mapboxMap.getStyle(), sourceProvider, buildFeatureProvider(options), bitmapProvider, options, internalRenderModeChangedListener, internalIndicatorPositionChangedListener, false); controller.setRenderMode(RenderMode.NORMAL); controller.setRenderMode(RenderMode.NORMAL); verify(internalRenderModeChangedListener, times(1)).onRenderModeChanged(RenderMode.NORMAL); }
@Test public void renderModeChanged_doNotNotifyAboutDuplicates_GPS() { OnRenderModeChangedListener internalRenderModeChangedListener = mock(OnRenderModeChangedListener.class); OnIndicatorPositionChangedListener internalIndicatorPositionChangedListener = mock(OnIndicatorPositionChangedListener.class); LayerSourceProvider sourceProvider = buildLayerProvider(); GeoJsonSource locationSource = mock(GeoJsonSource.class); when(sourceProvider.generateSource(any(Feature.class))).thenReturn(locationSource); LayerBitmapProvider bitmapProvider = mock(LayerBitmapProvider.class); LocationComponentOptions options = mock(LocationComponentOptions.class); LocationLayerController controller = new LocationLayerController(mapboxMap, mapboxMap.getStyle(), sourceProvider, buildFeatureProvider(options), bitmapProvider, options, internalRenderModeChangedListener, internalIndicatorPositionChangedListener, false); controller.setRenderMode(RenderMode.GPS); controller.setRenderMode(RenderMode.GPS); verify(internalRenderModeChangedListener, times(1)).onRenderModeChanged(RenderMode.GPS); }