class DefaultLegacySupport implements LegacySupport {

    private static final ThreadLocal<AtomicReference<MavenSession>> SESSION = new InheritableThreadLocal<>();

    public void setSession(MavenSession session) {<FILL_FUNCTION_BODY>}

    public MavenSession getSession() {
        AtomicReference<MavenSession> currentSession = DefaultLegacySupport.SESSION.get();
        return currentSession != null ? currentSession.get() : null;
    }

    public RepositorySystemSession getRepositorySession() {
        MavenSession session = getSession();
        return (session != null) ? session.getRepositorySession() : null;
    }
}

        AtomicReference<MavenSession> reference = DefaultLegacySupport.SESSION.get();
        if (reference != null) {
            reference.set(null);
        }

        if (session == null && reference != null) {
            DefaultLegacySupport.SESSION.remove();
        } else {
            DefaultLegacySupport.SESSION.set(new AtomicReference<>(session));
        }
    
<no_super_class>