@Test
public void shouldOverrideUrlLoading_withCustomApplicationIntent_withUserClick_andCanHandleCustomIntent_shouldTryToLaunchCustomIntent() throws Exception {

    String customUrl = "myintent://something";
    stub(htmlWebView.wasClicked()).toReturn(true);
    subject = new HtmlWebViewClient(htmlWebViewListener, htmlWebView, null, null);
    Robolectric.packageManager.addResolveInfoForIntent(new Intent(Intent.ACTION_VIEW, Uri.parse(customUrl)), new ResolveInfo());
    boolean didOverrideUrl = subject.shouldOverrideUrlLoading(htmlWebView, customUrl);
    assertThat(didOverrideUrl).isTrue();
    verify(htmlWebViewListener).onClicked();
    assertActivityStarted();
}