### Question:
SpiLoader { public static <T> List<T> loadInstanceList(Class<T> clazz) { try { String key = clazz.getName(); ServiceLoader<T> serviceLoader = SERVICE_LOADER_MAP.get(key); if (serviceLoader == null) { serviceLoader = ServiceLoaderUtil.getServiceLoader(clazz); SERVICE_LOADER_MAP.put(key, serviceLoader); } List<T> list = new ArrayList<>(); for (T spi : serviceLoader) { RecordLog.info("[SpiLoader] Found {} SPI: {}", clazz.getSimpleName(), spi.getClass().getCanonicalName()); list.add(spi); } return list; } catch (Throwable t) { RecordLog.error("[SpiLoader] ERROR: loadInstanceList failed", t); t.printStackTrace(); return new ArrayList<>(); } } private  SpiLoader(); static T loadFirstInstance(Class<T> clazz); static T loadFirstInstanceOrDefault(Class<T> clazz, Class<? extends T> defaultClass); static T loadHighestPriorityInstance(Class<T> clazz); static List<T> loadInstanceList(Class<T> clazz); static List<T> loadInstanceListSorted(Class<T> clazz); static List<T> loadPrototypeInstanceListSorted(Class<T> clazz);  }### Answer:
@Test public void testLoadInstanceList() { List<ProcessorSlot> slots = SpiLoader.loadInstanceList(ProcessorSlot.class); assertNotNull(slots); assertEquals(8, slots.size()); ProcessorSlot firstSlot = slots.get(0); List<ProcessorSlot> slots2 = SpiLoader.loadInstanceList(ProcessorSlot.class); assertNotSame(slots, slots2); ProcessorSlot firstSlot2 = slots2.get(0); assertSame(firstSlot, firstSlot2); }