### Question:
EncoderFactoryMap { public EncoderFactory findFactory(ReportSession session, String... ids) { for (String id : ids) { for (EncoderFactory factory : factoryById.get(id)) { BasicContent basicContent = session.createContent(BasicContent.class); if (factory.supports(basicContent)) { return factory; } } } return new NullEncoderFactory(ids[0]); } EncoderFactoryMap(ObjectFactory objectFactory); EncoderFactory findFactory(ReportSession session, String... ids);  }### Answer:
@Test public void discoversFactoryForSessionContent() throws Exception { EncoderFactory expectation = new DummyEncoderFactory(TEST_ID); objectFactory.add(EncoderFactory.class, expectation); EncoderFactoryMap map = new EncoderFactoryMap(objectFactory); assertThat(map.findFactory(session, TEST_ID), is(expectation)); }