UrlFromStringModel implements IModel<URL> { @Override public void detach() { model.detach(); } UrlFromStringModel(IModel<String> model); @Override URL getObject(); @Override void setObject(URL object); @Override void detach();  }
@Test public void testDetach() { final IModel innerModel = context.mock(IModel.class); final UrlFromStringModel instance = new UrlFromStringModel(innerModel); context.checking(new Expectations() { { oneOf(innerModel).detach(); } }); instance.detach(); }