SubViewMap implements SubViewRegistry { public <T> T get(Class<T> viewClass) { return factories.get(viewClass).create(); } SubViewMap(ObjectFactory objectFactory); T get(Class<T> viewClass);  }
@Test public void containsFactoryForRegisteredViewClass() throws Exception { DummyView expectation = new DummyView(); factory.add(SubViewFactory.class, new ConfigurableViewFactory(expectation)); DummyView result = new SubViewMap(factory).get(DummyView.class); assertThat(result, is(expectation)); }