class DefaultVersionRangeResolver implements VersionRangeResolver {

    private final RepositorySystem repositorySystem;

    @Inject
    public DefaultVersionRangeResolver(RepositorySystem repositorySystem) {
        this.repositorySystem = repositorySystem;
    }

    @Override
    public VersionRangeResolverResult resolve(VersionRangeResolverRequest request)
            throws VersionRangeResolverException {<FILL_FUNCTION_BODY>}
}

        nonNull(request, "request");
        InternalSession session = InternalSession.from(request.getSession());

        try {
            VersionRangeResult res = repositorySystem.resolveVersionRange(
                    session.getSession(),
                    new VersionRangeRequest(
                            session.toArtifact(request.getArtifactCoordinate()),
                            session.toRepositories(session.getRemoteRepositories()),
                            null));

            Map<String, ArtifactRepository> repos = res.getVersions().stream()
                    .filter(v -> res.getRepository(v) != null)
                    .collect(Collectors.toMap(v -> v.toString(), res::getRepository));

            return new VersionRangeResolverResult() {
                @Override
                public List<Exception> getExceptions() {
                    return res.getExceptions();
                }

                @Override
                public List<Version> getVersions() {
                    return map(res.getVersions(), v -> session.parseVersion(v.toString()));
                }

                @Override
                public Optional<Repository> getRepository(Version version) {
                    ArtifactRepository repo = repos.get(version.toString());
                    if (repo instanceof org.eclipse.aether.repository.LocalRepository) {
                        return Optional.of(
                                new DefaultLocalRepository((org.eclipse.aether.repository.LocalRepository) repo));
                    } else if (repo instanceof org.eclipse.aether.repository.RemoteRepository) {
                        return Optional.of(
                                new DefaultRemoteRepository((org.eclipse.aether.repository.RemoteRepository) repo));
                    } else {
                        return Optional.empty();
                    }
                }
            };
        } catch (VersionRangeResolutionException e) {
            throw new VersionRangeResolverException("Unable to resolve version range", e);
        }
    
<no_super_class>