class DefaultVersionResolver implements VersionResolver {

    private final RepositorySystem repositorySystem;

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

    @Override
    public VersionResolverResult resolve(VersionResolverRequest request) throws VersionResolverException {<FILL_FUNCTION_BODY>}
}

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

        try {
            VersionResult res = repositorySystem.resolveVersion(
                    session.getSession(),
                    new VersionRequest(
                            session.toArtifact(request.getArtifactCoordinate()),
                            session.toRepositories(session.getRemoteRepositories()),
                            null));

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

                @Override
                public Version getVersion() {
                    return session.parseVersion(res.getVersion());
                }

                @Override
                public Optional<Repository> getRepository() {
                    if (res.getRepository() instanceof org.eclipse.aether.repository.LocalRepository) {
                        return Optional.of(new DefaultLocalRepository(
                                (org.eclipse.aether.repository.LocalRepository) res.getRepository()));
                    } else if (res.getRepository() instanceof org.eclipse.aether.repository.RemoteRepository) {
                        return Optional.of(new DefaultRemoteRepository(
                                (org.eclipse.aether.repository.RemoteRepository) res.getRepository()));
                    } else {
                        return Optional.empty();
                    }
                }
            };
        } catch (VersionResolutionException e) {
            throw new VersionResolverException("Unable to resolve version", e);
        }
    
<no_super_class>