class DefaultToolchainManager implements ToolchainManager {
    private final DefaultToolchainManagerPrivate toolchainManagerPrivate;

    @Inject
    public DefaultToolchainManager(DefaultToolchainManagerPrivate toolchainManagerPrivate) {
        this.toolchainManagerPrivate = toolchainManagerPrivate;
    }

    @Override
    public List<Toolchain> getToolchains(Session session, String type, Map<String, String> requirements)
            throws ToolchainManagerException {
        MavenSession s = InternalMavenSession.from(session).getMavenSession();
        List<org.apache.maven.toolchain.Toolchain> toolchains =
                toolchainManagerPrivate.getToolchains(s, type, requirements);
        return new MappedList<>(toolchains, this::toToolchain);
    }

    @Override
    public Optional<Toolchain> getToolchainFromBuildContext(Session session, String type)
            throws ToolchainManagerException {
        MavenSession s = InternalMavenSession.from(session).getMavenSession();
        return Optional.ofNullable(toolchainManagerPrivate.getToolchainFromBuildContext(type, s))
                .map(this::toToolchain);
    }

    @Override
    public List<Toolchain> getToolchainsForType(Session session, String type) throws ToolchainManagerException {
        try {
            MavenSession s = InternalMavenSession.from(session).getMavenSession();
            ToolchainPrivate[] toolchains = toolchainManagerPrivate.getToolchainsForType(type, s);
            return new MappedList<>(Arrays.asList(toolchains), this::toToolchain);
        } catch (MisconfiguredToolchainException e) {
            throw new ToolchainManagerException("Unable to get toochains for type " + type, e);
        }
    }

    @Override
    public void storeToolchainToBuildContext(Session session, Toolchain toolchain) throws ToolchainManagerException {<FILL_FUNCTION_BODY>}

    private Toolchain toToolchain(org.apache.maven.toolchain.Toolchain toolchain) {
        return new ToolchainWrapper(toolchain);
    }

    private static class ToolchainWrapper implements Toolchain {
        private final org.apache.maven.toolchain.Toolchain toolchain;

        ToolchainWrapper(org.apache.maven.toolchain.Toolchain toolchain) {
            this.toolchain = toolchain;
        }

        @Override
        public String getType() {
            return toolchain.getType();
        }

        @Override
        public String findTool(String toolName) {
            return toolchain.findTool(toolName);
        }

        @Override
        public boolean matchesRequirements(Map<String, String> requirements) {
            return ((ToolchainPrivate) toolchain).matchesRequirements(requirements);
        }
    }
}

        MavenSession s = InternalMavenSession.from(session).getMavenSession();
        org.apache.maven.toolchain.ToolchainPrivate tc =
                (org.apache.maven.toolchain.ToolchainPrivate) ((ToolchainWrapper) toolchain).toolchain;
        toolchainManagerPrivate.storeToolchainToBuildContext(tc, s);
    
<no_super_class>