class MavenArtifactTypeRegistry implements ArtifactTypeRegistry {

        private final ArtifactHandlerManager handlerManager;

        MavenArtifactTypeRegistry(ArtifactHandlerManager handlerManager) {
            this.handlerManager = handlerManager;
        }

        public ArtifactType get(String stereotypeId) {
            ArtifactHandler handler = handlerManager.getArtifactHandler(stereotypeId);
            return newArtifactType(stereotypeId, handler);
        }
    }

    public static Collection<Artifact> toArtifacts(Collection<org.apache.maven.artifact.Artifact> artifactsToConvert) {
        return artifactsToConvert.stream().map(RepositoryUtils::toArtifact).collect(Collectors.toList());
    }

    public static WorkspaceRepository getWorkspace(RepositorySystemSession session) {
        WorkspaceReader reader = session.getWorkspaceReader();
        return (reader != null) ? reader.getRepository() : null;
    }

    public static boolean repositoriesEquals(List<RemoteRepository> r1, List<RemoteRepository> r2) {
        if (r1.size() != r2.size()) {
            return false;
        }

        for (Iterator<RemoteRepository> it1 = r1.iterator(), it2 = r2.iterator(); it1.hasNext(); ) {
            if (!repositoryEquals(it1.next(), it2.next())) {
                return false;
            }
        }

        return true;
    }

    public static int repositoriesHashCode(List<RemoteRepository> repositories) {
        int result = 17;
        for (RemoteRepository repository : repositories) {
            result = 31 * result + repositoryHashCode(repository);
        }
        return result;
    }

    public static RepositorySystemSession overlay(
            ArtifactRepository repository, RepositorySystemSession session, RepositorySystem system) {<FILL_FUNCTION_BODY>

        if (repository == null || repository.getBasedir() == null) {
            return session;
        }

        DefaultRepositorySystemSession newSession;
        if (session != null) {
            LocalRepositoryManager lrm = session.getLocalRepositoryManager();
            if (lrm != null && lrm.getRepository().getBasedir().equals(new File(repository.getBasedir()))) {
                return session;
            }
            newSession = new DefaultRepositorySystemSession(session);
        } else {
            newSession = new DefaultRepositorySystemSession(h -> false); // no close handle used
        }

        final LocalRepositoryManager llrm =
                system.newLocalRepositoryManager(newSession, new LocalRepository(repository.getBasedir()));
        newSession.setLocalRepositoryManager(llrm);
        return newSession;
    
<no_super_class>