MapView extends RelativeLayout { public void onDestroy() { mapInitializer.takeDown(); if (mapzenMap != null) { mapzenMap.onDestroy(); } getTangramMapView().onDestroy(); } MapView(Context context);  MapView(Context context, AttributeSet attrs); @NonNull TangramMapView getTangramMapView(); void getMapAsync(@NonNull OnMapReadyCallback callback); void getMapAsync(@NonNull String mapId, @NonNull OnMapReadyCallback callback); void getMapAsync(@NonNull MapStyle mapStyle, @NonNull OnMapReadyCallback callback); void getMapAsync(String mapId, MapStyle mapStyle, @NonNull OnMapReadyCallback callback); void getMapAsync(@NonNull MapStyle mapStyle, @NonNull Locale locale,
      @NonNull OnMapReadyCallback callback); void getMapAsync(MapStyle mapStyle, String mapId, Locale locale,
      @NonNull OnMapReadyCallback callback); @NonNull CompassView getCompass(); @NonNull CompassView showCompass(); void hideCompass(); @NonNull ImageButton getFindMe(); @NonNull ImageButton showFindMe(); void hideFindMe(); @NonNull ImageButton getZoomIn(); @NonNull ImageButton showZoomIn(); void hideZoomIn(); @NonNull ImageButton getZoomOut(); @NonNull ImageButton showZoomOut(); void hideZoomOut(); @NonNull TextView getAttribution(); void onDestroy(); static final int OVERLAY_MODE_SDK; static final int OVERLAY_MODE_CLASSIC; }
@Test public void onDestroy_shouldTakedownInitializer() throws Exception { MapInitializer initializer = mock(MapInitializer.class); mapView.mapInitializer = initializer; mapView.onDestroy(); verify(initializer).takeDown(); }