@Test
public void removeLayerOnMapShouldReturnTrueWhenStyleIsReadyAndRemoveLayersAndSources() throws InvalidArrowLineConfigException {

    ArrayList<Feature> featuresList = new ArrayList<>();
    FeatureCollection featureCollection = FeatureCollection.fromFeatures(featuresList);
    ArrowLineLayer.FeatureConfig featureConfig = new ArrowLineLayer.FeatureConfig(featureCollection);
    ArrowLineLayer.SortConfig sortConfig = new ArrowLineLayer.SortConfig("", ArrowLineLayer.SortConfig.SortOrder.DESC, ArrowLineLayer.SortConfig.PropertyType.NUMBER);
    ArrowLineLayer.Builder builder = new ArrowLineLayer.Builder(context, featureConfig, sortConfig);
    ArrowLineLayer arrowLineLayer = builder.build();
    MapboxMap mapboxMap = Mockito.mock(MapboxMap.class);
    Style style = Mockito.mock(Style.class);
    SymbolLayer arrowHeadLayer = Mockito.mock(SymbolLayer.class);
    LineLayer lineLayer = Mockito.mock(LineLayer.class);
    GeoJsonSource arrowHeadSource = new GeoJsonSource("some-id");
    GeoJsonSource lineLayerSource = new GeoJsonSource("some-id-2");
    Mockito.doReturn(true)
            .when(style)
            .isFullyLoaded();
    Mockito.doReturn(style)
            .when(mapboxMap)
            .getStyle();
    ReflectionHelpers.setField(arrowLineLayer, "arrowHeadLayer", arrowHeadLayer);
    ReflectionHelpers.setField(arrowLineLayer, "lineLayer", lineLayer);
    ReflectionHelpers.setField(arrowLineLayer, "arrowHeadSource", arrowHeadSource);
    ReflectionHelpers.setField(arrowLineLayer, "lineLayerSource", lineLayerSource);
    assertTrue(arrowLineLayer.removeLayerOnMap(mapboxMap));
    Mockito.verify(style, Mockito.times(1))
            .removeLayer(ArgumentMatchers.eq(arrowHeadLayer));
    Mockito.verify(style, Mockito.times(1))
            .removeLayer(ArgumentMatchers.eq(lineLayer));
    Mockito.verify(style, Mockito.times(1))
            .removeSource(ArgumentMatchers.eq(arrowHeadSource));
    Mockito.verify(style, Mockito.times(1))
            .removeSource(ArgumentMatchers.eq(lineLayerSource));
}