### Question:
SpiLoader { public static <T> T loadHighestPriorityInstance(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); } SpiOrderWrapper<T> w = null; for (T spi : serviceLoader) { int order = SpiOrderResolver.resolveOrder(spi); RecordLog.info("[SpiLoader] Found {} SPI: {} with order {}", clazz.getSimpleName(), spi.getClass().getCanonicalName(), order); if (w == null || order < w.order) { w = new SpiOrderWrapper<>(order, spi); } } return w == null ? null : w.spi; } catch (Throwable t) { RecordLog.error("[SpiLoader] ERROR: loadHighestPriorityInstance failed", t); t.printStackTrace(); return null; } } 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 testLoadHighestPriorityInstance() { ProcessorSlot processorSlot = SpiLoader.loadHighestPriorityInstance(ProcessorSlot.class); assertNotNull(processorSlot); assertTrue(processorSlot instanceof NodeSelectorSlot); ProcessorSlot processorSlot2 = SpiLoader.loadHighestPriorityInstance(ProcessorSlot.class); assertSame(processorSlot, processorSlot2); }