List<ApplicationContextDestroyer> destroyers = new ArrayList<ApplicationContextDestroyer>();
destroyers.add(applicationContextDestroyer);
ServiceLoader serviceLoader = mock(ServiceLoader.class);
when(serviceLoader.all(ApplicationContextDestroyer.class)).thenReturn(destroyers);
Instance<ServiceLoader> mockServiceLoader = mock(Instance.class);
when(mockServiceLoader.get()).thenReturn(serviceLoader);
TestReflectionHelper.setFieldValue(instance, "serviceLoaderInstance", mockServiceLoader);