### Question:
Factory implements HandlerListener { public Setup getSetup(Media media) { Check.notNull(media); if (!setups.containsKey(media)) { setups.put(media, createSetup(media)); } return setups.get(media); } Factory(Services services); @SuppressWarnings("unchecked") O create(Media media); @SuppressWarnings("unchecked") O create(Media media, Class<O> type); void createCache(Media folder, int count); void setClassLoader(ClassLoader classLoader); Setup getSetup(Media media); @Override void notifyHandlableAdded(Featurable featurable); @Override void notifyHandlableRemoved(Featurable featurable); static final String FILE_DATA_EXTENSION; static final String FILE_DATA_DOT_EXTENSION; }### Answer:
@Test void testGetSetup() { final Setup setup = factory.getSetup(Medias.create("Object.xml")); assertEquals(Medias.create("Object.xml"), setup.getMedia()); assertEquals(setup, factory.getSetup(Medias.create("Object.xml"))); assertEquals(setup, factory.getSetup(Medias.create("Object.xml"))); }