### Question:
MapWayname { void updateWaynameVisibility(boolean isVisible, SymbolLayer waynameLayer) { this.isVisible = isVisible; adjustMapPadding(isVisible); if (checkWaynameVisibility(isVisible, waynameLayer)) { return; } adjustWaynameVisibility(isVisible, waynameLayer); } MapWayname(WaynameLayoutProvider layoutProvider, MapLayerInteractor layerInteractor,
             WaynameFeatureFinder featureInteractor, MapPaddingAdjustor paddingAdjustor);   }### Answer:
@Test public void onVisibiltySetToFalse_paddingIsAdjusted() { SymbolLayer waynameLayer = mock(SymbolLayer.class); when(waynameLayer.getVisibility()).thenReturn(visibility(Property.VISIBLE)); MapLayerInteractor layerInteractor = mock(MapLayerInteractor.class); when(layerInteractor.retrieveLayerFromId(MAPBOX_WAYNAME_LAYER)).thenReturn(waynameLayer); MapPaddingAdjustor paddingAdjustor = mock(MapPaddingAdjustor.class); MapWayname mapWayname = buildMapWayname(layerInteractor, paddingAdjustor); mapWayname.updateWaynameVisibility(false, waynameLayer); verify(paddingAdjustor).updateTopPaddingWithDefault(); }
@Test public void onVisibiltySetToTrue_paddingIsAdjusted() { SymbolLayer waynameLayer = mock(SymbolLayer.class); when(waynameLayer.getVisibility()).thenReturn(visibility(Property.NONE)); MapLayerInteractor layerInteractor = mock(MapLayerInteractor.class); when(layerInteractor.retrieveLayerFromId(MAPBOX_WAYNAME_LAYER)).thenReturn(waynameLayer); MapPaddingAdjustor paddingAdjustor = mock(MapPaddingAdjustor.class); MapWayname mapWayname = buildMapWayname(layerInteractor, paddingAdjustor); mapWayname.updateWaynameVisibility(true, waynameLayer); verify(paddingAdjustor).updateTopPaddingWithWayname(); }