public void load() {
    Set<CoreExtension> coreExtensions = serviceLoaderWrapper.load(getClass().getClassLoader());
    ensureNoDuplicateName(coreExtensions);

    coreExtensionRepository.setLoadedCoreExtensions(coreExtensions);
    if (!coreExtensions.isEmpty()) {
      LOG.info("Loaded core extensions: {}", coreExtensions.stream().map(CoreExtension::getName).collect(Collectors.joining(", ")));
    }
  }
@Test
  public void load_fails_with_ISE_if_multiple_core_extensions_declare_same_names() {
    Set<CoreExtension> coreExtensions = ImmutableSet.of(newCoreExtension("a"), newCoreExtension("a"), newCoreExtension("b"), newCoreExtension("b"));
    when(serviceLoaderWrapper.load(any())).thenReturn(coreExtensions);

    assertThatThrownBy(() -> underTest.load())
      .isInstanceOf(IllegalStateException.class)
      .hasMessage("Multiple core extensions declare the following names: a, b");
  }