ResolvingLinkModel implements IModel<String> { @Override public void detach() { resolveSubjectModel.detach(); resolveObjectModel.detach(); } ResolvingLinkModel(IModel<String> resolveSubjectModel, IModel<String> resolveObjectModel); @Override String getObject(); static ResolvingLinkModel modelFor(IModel<ResourceInfo>  resourceInfoModel, IModel<SolrDocument> documentModel); @Override void setObject(String object); @Override void detach();  }
@Test public void testDetach() { final IModel subject = context.mock(IModel.class, "subjectModel"); final IModel object = context.mock(IModel.class, "objectModel"); context.checking(new Expectations() { { oneOf(subject).detach(); oneOf(object).detach(); } }); ResolvingLinkModel instance = new ResolvingLinkModel(subject, object); instance.detach(); }