### Question:
ExtensionLoader { public static <T> T getExtensionWithName(Class<T> clazz, String name) { List<T> extensions = getExtensionList(clazz); String interfaceName = clazz.getSimpleName(); for (T extension : extensions) { String className = extension.getClass().getSimpleName(); String subClassPrefix = className.substring(0, className.indexOf(interfaceName)); if (name.equalsIgnoreCase(subClassPrefix)) { return extension; } } throw new RpcException("Not find " + clazz.getName() + " with name " + name + ", please check spi config"); } private  ExtensionLoader(); static T getExtension(Class<T> clazz); static T getExtensionWithName(Class<T> clazz, String name); static List<T> getExtensionListByRole(Class<T> clazz, RpcRole role); static T getExtensionByRole(Class<T> clazz, RpcRole role); static List<T> getExtensionList(Class<T> clazz); static T getNewExtension(Class<T> clazz); static List<T> newExtensionList(Class<T> clazz);  }### Answer:
@Test public void testGetExtensionWithName() { Extension extension = ExtensionLoader.getExtensionWithName(Extension.class, "First"); Assert.assertTrue(extension instanceof FirstExtension); }