class MraidBridge {

    @VisibleForTesting
    boolean handleShouldOverrideUrl(@NonNull final String url) {
        URI uri;
        try {
            uri = new URI(url);
        } catch (URISyntaxException e) {
            MoPubLog.w("Invalid MRAID URL: " + url);
            fireErrorEvent(MraidJavascriptCommand.UNSPECIFIED, "Mraid command sent an invalid URL");
            return true;
        }

        // Note that scheme will be null when we are passed a relative Uri
        String scheme = uri.getScheme();

        if ("mopub".equals(scheme)) {
            return true;
        }

        if ("mraid".equals(scheme)) {
            String host = uri.getHost();
            Map<String, String> params = new HashMap<String, String>();
            for (NameValuePair pair : URLEncodedUtils.parse(uri, "UTF-8")) {
                params.put(pair.getName(), pair.getValue());
            }
            MraidJavascriptCommand command = MraidJavascriptCommand.fromJavascriptString(host);
            try {
                runCommand(command, params);
            } catch (MraidCommandException exception) {
                fireErrorEvent(command, exception.getMessage());
            }
            fireNativeCommandCompleteEvent(command);
            return true;
        }

        if (mIsClicked) {
            Intent intent = new Intent();
            intent.setAction(Intent.ACTION_VIEW);
            intent.setData(Uri.parse(url));
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

            try {
                if (mMraidWebView == null) {
                    MoPubLog.d("WebView was detached. Unable to load a URL");
                    return true;
                }
                mMraidWebView.getContext().startActivity(intent);
                return true;
            } catch (ActivityNotFoundException e) {
                MoPubLog.d("No activity found to handle this URL " + url);
                return false;
            }
        }

        return false;
    }

      MraidBridge(@NonNull AdConfiguration adConfiguration,
            @NonNull PlacementType placementType);
    @VisibleForTesting  MraidBridge(@NonNull AdConfiguration adConfiguration,
            @NonNull PlacementType placementType,
            @NonNull MraidNativeCommandHandler mraidNativeCommandHandler);

}