### Question:
ExtensionLoader { private T injectExtension(T instance) { try { if (objectFactory != null) { for (Method method : instance.getClass().getMethods()) { if (method.getName().startsWith("set") && method.getParameterTypes().length == 1 && Modifier.isPublic(method.getModifiers())) { if (method.getAnnotation(DisableInject.class) != null) { continue; } Class<?> pt = method.getParameterTypes()[0]; if (ReflectUtils.isPrimitives(pt)) { continue; } try { String property = method.getName().length() > 3 ? method.getName().substring(3, 4).toLowerCase() + method.getName().substring(4) : ""; Object object = objectFactory.getExtension(pt, property); if (object != null) { method.invoke(instance, object); } } catch (Exception e) { logger.error("fail to inject via method " + method.getName() + " of interface " + type.getName() + ": " + e.getMessage(), e); } } } } } catch (Exception e) { logger.error(e.getMessage(), e); } return instance; } private  ExtensionLoader(Class<?> type); @SuppressWarnings("unchecked") static ExtensionLoader<T> getExtensionLoader(Class<T> type); static void resetExtensionLoader(Class type); String getExtensionName(T extensionInstance); String getExtensionName(Class<?> extensionClass); List<T> getActivateExtension(URL url, String key); List<T> getActivateExtension(URL url, String[] values); List<T> getActivateExtension(URL url, String key, String group); List<T> getActivateExtension(URL url, String[] values, String group); @SuppressWarnings("unchecked") T getLoadedExtension(String name); Set<String> getLoadedExtensions(); Object getLoadedAdaptiveExtensionInstances(); @SuppressWarnings("unchecked") T getExtension(String name); T getDefaultExtension(); boolean hasExtension(String name); Set<String> getSupportedExtensions(); String getDefaultExtensionName(); void addExtension(String name, Class<?> clazz); @Deprecated void replaceExtension(String name, Class<?> clazz); @SuppressWarnings("unchecked") T getAdaptiveExtension(); @Override String toString();  }### Answer:
@Test public void testInjectExtension() { InjectExt injectExt = ExtensionLoader.getExtensionLoader(InjectExt.class).getExtension("injection"); InjectExtImpl injectExtImpl = (InjectExtImpl) injectExt; Assertions.assertNotNull(injectExtImpl.getSimpleExt()); Assertions.assertNull(injectExtImpl.getSimpleExt1()); Assertions.assertNull(injectExtImpl.getGenericType()); }