UrlSpanFactory { URLSpan createSpanFor(final String webLinkUrl) { return new URLSpan(webLinkUrl) { @Override public void onClick(View widget) { onWebLinkClickedListener.onClick(webLinkUrl); } }; } UrlSpanFactory(OnWebLinkClickedListener onWebLinkClickedListener);   }
@Test public void factoryCreatesSpanWithCorrectClickListener() { URLSpan urlSpan = factory.createSpanFor(WEB_URL); urlSpan.onClick(any(View.class)); verify(mockListener).onClick(WEB_URL); }