Router { public Router mismatched(MismatchedHandler mismatchedHandler) { this.mismatchedHandler = mismatchedHandler; return this; } Router(UrlMatcher urlMatcher, RouteCompiler routeCompiler, Context context);  Router(Context context); Router setContext(Context context); Context getContext(); Router mismatched(MismatchedHandler mismatchedHandler); Router add(Route route); Router add(String path, Class<? extends Activity> activityClass); Router asShared(); static Router getShared(); void open(String url); void open(String url, Context context); void open(String url, Bundle bundle); void open(String url, Context context, Bundle bundle); void openForResult(String url, Activity sourceActivity, int requestCode); void openForResult(String url, Activity sourceActivity, int requestCode, Bundle bundle); void openExternal(String url); Intent getIntent(String url, Bundle bundle, Context context); Request getRequest(Bundle bundle); void proxy(Bundle bundle, RouterProxy routerProxy); void proxy(Request request, RouterProxy routerProxy); static final String BUNDLE_KEY_REQUEST; }
@Test public void testMismatched() throws InterruptedException { router.add(new Route("github.com/test", Activity.class)); router.mismatched(new MismatchedHandler() { @Override public void run(Request request, Router router) { mismatched = true; } }); router.open("https: assertFalse(mismatched); router.open("https: assertFalse(mismatched); router.open("https: assertTrue(mismatched); }