public static Map<String, String> computeAliases(PluginScanResult scanResult) {
        Map<String, Set<String>> aliasCollisions = new HashMap<>();
        scanResult.forEach(pluginDesc -> {
            aliasCollisions.computeIfAbsent(simpleName(pluginDesc), ignored -> new HashSet<>()).add(pluginDesc.className());
            aliasCollisions.computeIfAbsent(prunedName(pluginDesc), ignored -> new HashSet<>()).add(pluginDesc.className());
        });
        Map<String, String> aliases = new HashMap<>();
        for (Map.Entry<String, Set<String>> entry : aliasCollisions.entrySet()) {
            String alias = entry.getKey();
            Set<String> classNames = entry.getValue();
            if (classNames.size() == 1) {
                aliases.put(alias, classNames.stream().findAny().get());
            } else {
                log.debug("Ignoring ambiguous alias '{}' since it refers to multiple distinct plugins {}", alias, classNames);
            }
        }
        return aliases;
    }
@Test
    public void testCollidingPrunedAlias() {
        SortedSet<PluginDesc<Converter>> converters = new TreeSet<>();
        converters.add(new PluginDesc<>(CollidingConverter.class, null, PluginType.CONVERTER, CollidingConverter.class.getClassLoader()));
        SortedSet<PluginDesc<HeaderConverter>> headerConverters = new TreeSet<>();
        headerConverters.add(new PluginDesc<>(CollidingHeaderConverter.class, null, PluginType.HEADER_CONVERTER, CollidingHeaderConverter.class.getClassLoader()));
        PluginScanResult result = new PluginScanResult(
                Collections.emptySortedSet(),
                Collections.emptySortedSet(),
                converters,
                headerConverters,
                Collections.emptySortedSet(),
                Collections.emptySortedSet(),
                Collections.emptySortedSet(),
                Collections.emptySortedSet(),
                Collections.emptySortedSet()
        );
        Map<String, String> actualAliases = PluginUtils.computeAliases(result);
        Map<String, String> expectedAliases = new HashMap<>();
        expectedAliases.put("CollidingConverter", CollidingConverter.class.getName());
        expectedAliases.put("CollidingHeaderConverter", CollidingHeaderConverter.class.getName());
        assertEquals(expectedAliases, actualAliases);
    }