### Question:
DefaultExtensionRegistry implements ExtensionRegistry { @Override public ExtensionInstallPlan planInstallation(String quarkusCore, Collection<String> keywords) { ExtensionInstallPlan.Builder builder = ExtensionInstallPlan.builder(); boolean multipleKeywords = keywords.size() > 1; for (String keyword : keywords) { int countColons = StringUtils.countMatches(keyword, ":"); if (countColons == 1) { AppArtifactKey artifactKey = AppArtifactKey.fromString(keyword); builder.addManagedExtension(new AppArtifactCoords(artifactKey, null)); continue; } else if (countColons > 1) { builder.addIndependentExtension(AppArtifactCoords.fromString(keyword)); continue; } List<ExtensionReleaseTuple> tuples = listInternalExtensions(quarkusCore, keyword); if (tuples.size() != 1 && multipleKeywords) { return ExtensionInstallPlan.EMPTY; } else if (tuples.size() > 1 && !ExtensionPredicate.isPattern(keyword)) { throw new MultipleExtensionsFoundException(keyword, tuples.stream().map(this::toQuarkusExtension).collect(Collectors.toList())); } for (ExtensionReleaseTuple tuple : tuples) { ArtifactKey id = tuple.getExtension().getId(); String groupId = id.getGroupId(); String artifactId = id.getArtifactId(); String version = tuple.getRelease().getRelease().getVersion(); AppArtifactCoords extensionCoords = new AppArtifactCoords(groupId, artifactId, version); List<AppArtifactCoords> platformCoords = tuple.getRelease().getPlatforms() .stream() .map(c -> new AppArtifactCoords( c.getCoords().getId().getGroupId(), c.getCoords().getId().getArtifactId(), "pom", c.getCoords().getVersion())) .collect(Collectors.toList()); if (platformCoords.isEmpty()) { builder.addIndependentExtension(extensionCoords); } else { builder.addManagedExtension(extensionCoords); for (AppArtifactCoords platformCoord : platformCoords) { builder.addPlatform(platformCoord); } } } } return builder.build(); } DefaultExtensionRegistry(Registry registry); static DefaultExtensionRegistry fromURLs(Collection<URL> urls); static DefaultExtensionRegistry fromPlatform(QuarkusPlatformDescriptor platform); @Override Set<String> getQuarkusCoreVersions(); @Override Set<Extension> getExtensionsByCoreVersion(String version); @Override Set<Extension> list(String quarkusCore, String keyword); @Override ExtensionInstallPlan planInstallation(String quarkusCore, Collection<String> keywords); Registry getRegistry();  }### Answer:
@Test void shouldLookupPlatformForDependentExtensionInQuarkusFinal() { ExtensionInstallPlan result = extensionRegistry.planInstallation("1.3.2.Final", Arrays.asList("quarkus-arc", "quarkus-vertx")); assertThat(result).isNotNull(); assertThat(result.getPlatforms()).hasSize(2); assertThat(result.getPlatforms()) .extracting(AppArtifactCoords::getArtifactId) .contains("quarkus-universe-bom", "quarkus-bom"); assertThat(result.getManagedExtensions()).hasSize(2); assertThat(result.getIndependentExtensions()).isEmpty(); }
@Test void shouldLookupNoPlatformForIndependentExtension() { ExtensionInstallPlan result = extensionRegistry.planInstallation("1.3.1.Final", Collections.singletonList("myfaces-quarkus-runtime")); assertThat(result).isNotNull(); assertThat(result.getPlatforms()).isEmpty(); assertThat(result.getManagedExtensions()).isEmpty(); assertThat(result.getIndependentExtensions()).hasSize(1); assertThat(result.getIndependentExtensions().iterator().next()) .hasFieldOrPropertyWithValue("groupId", "org.apache.myfaces.core.extensions.quarkus") .hasFieldOrPropertyWithValue("artifactId", "myfaces-quarkus-runtime") .hasFieldOrPropertyWithValue("version", "2.3-next-M2"); }