### Question:
ExtensionManager { public static <T, M> T getOrLoadExtension(final Class<T> extensible, final M name) { ExtensionPoint<T, M> spi = SNAPSHOT.getOrLoadExtensionPoint(extensible, null, AscendingComparator.INSTANCE, null); return spi == null ? null : spi.get(name); }  static T getExtension(final String type, final M name); static T getExtension(final Class<T> extensible, final M name); static T getOrLoadExtension(final Class<T> extensible, final M name); static T getOrLoadExtension(final Class<T> extensible); static Iterable<T> getExtensions(final Class<T> extensible); static Iterable<T> getOrLoadExtensions(final Class<T> extensible); static Iterable<T> get(final String type); static ExtensionPoint<T, M> getOrLoadExtensionPoint(final Class<T> extensible); static ExtensionPoint<T, M> getOrLoadExtensionPoint(final Class<T> extensible, final ExtensionLoader loader); static ExtensionPoint<T, M> getOrLoadExtensionPoint(final Class<T> extensible,
                                                                      final Comparator<ExtensionMeta<?, ?>> comparator); static ExtensionPoint<T, M> getOrLoadExtensionPoint(final Class<T> extensible,
                                                                      final ExtensionLoader loader,
                                                                      final Comparator<ExtensionMeta<?, ?>> comparator); static ExtensionPoint<T, M> getOrLoadExtensionPoint(final Class<T> extensible,
                                                                      final ExtensionLoader loader,
                                                                      final Comparator<ExtensionMeta<?, ?>> comparator,
                                                                      final Classify<T, M> classify); static void loadExtension(final Collection<Class<?>> extensibles); static void loadExtension(final Collection<Class<?>> extensibles, final ExtensionLoader loader); static void loadExtension(final ExtensionScanner scanner); static void loadExtension(final ExtensionScanner scanner, final ExtensionLoader loader); synchronized static void register(final ExtensionLoader loader); synchronized static void deregister(final ExtensionLoader loader); static boolean addListener(final ExtensionListener listener);  }### Answer:
@Test public void testGetOrLoad() { Consumer c1 = ExtensionManager.getOrLoadExtension(Consumer.class); Consumer c2 = ExtensionManager.getOrLoadExtension(Consumer.class); Assert.assertNotNull(c1); Assert.assertEquals(c1, c2); }
@Test public void testPrototype() { Producer producer1 = ExtensionManager.getOrLoadExtension(Producer.class, "io.joyrpc.extension.MyProducer"); Assert.assertNotNull(producer1); Producer producer2 = ExtensionManager.getOrLoadExtension(Producer.class, "io.joyrpc.extension.MyProducer"); Assert.assertNotEquals(producer1, producer2); }