// Path: android-maps-extensions/src/main/java/com/androidmapsextensions/impl/ExtendedMapFactory.java
// public final class ExtendedMapFactory {
// 
//     private ExtendedMapFactory() {
//     }
// 
//     public static GoogleMap create(com.google.android.gms.maps.GoogleMap real, Context context) {
//         return new DelegatingGoogleMap(new GoogleMapWrapper(real), context);
//     }
// }


import android.content.Context;
import com.androidmapsextensions.impl.ExtendedMapFactory;
import java.lang.reflect.Method;
package com.androidmapsextensions;




final class MapHolder {

    public interface Delegate {

        // This function no longer exist in new versions of Google Maps Android API v2,
        // so we get access to it via reflection whenever possible
        //com.google.android.gms.maps.GoogleMap getMap();

        void getMapAsync(com.google.android.gms.maps.OnMapReadyCallback callback);

        Context getContext();
    }

    private final Delegate delegate;
    private GoogleMap map;

    public MapHolder(Delegate delegate) {
        this.delegate = delegate;
    }

    public GoogleMap getExtendedMap() {
        if (map == null) {
            try {
                Method getMapMethod = delegate.getClass().getMethod("getMap");
                Object obj = getMapMethod.invoke(delegate);
                if (obj != null) {
                    com.google.android.gms.maps.GoogleMap realMap = (com.google.android.gms.maps.GoogleMap) obj;
// Path: android-maps-extensions/src/main/java/com/androidmapsextensions/impl/ExtendedMapFactory.java
// public final class ExtendedMapFactory {
// 
//     private ExtendedMapFactory() {
//     }
// 
//     public static GoogleMap create(com.google.android.gms.maps.GoogleMap real, Context context) {
//         return new DelegatingGoogleMap(new GoogleMapWrapper(real), context);
//     }
// }


// Path: android-maps-extensions/src/main/java/com/androidmapsextensions/MapHolder.java
import android.content.Context;
import com.androidmapsextensions.impl.ExtendedMapFactory;
import java.lang.reflect.Method;

package com.androidmapsextensions;




final class MapHolder {

    public interface Delegate {

        // This function no longer exist in new versions of Google Maps Android API v2,
        // so we get access to it via reflection whenever possible
        //com.google.android.gms.maps.GoogleMap getMap();

        void getMapAsync(com.google.android.gms.maps.OnMapReadyCallback callback);

        Context getContext();
    }

    private final Delegate delegate;
    private GoogleMap map;

    public MapHolder(Delegate delegate) {
        this.delegate = delegate;
    }

    public GoogleMap getExtendedMap() {
        if (map == null) {
            try {
                Method getMapMethod = delegate.getClass().getMethod("getMap");
                Object obj = getMapMethod.invoke(delegate);
                if (obj != null) {
                    com.google.android.gms.maps.GoogleMap realMap = (com.google.android.gms.maps.GoogleMap) obj;
                    map = ExtendedMapFactory.create(realMap, delegate.getContext());