class ApplicationContextHolder implements ApplicationContextAware {

    private static ApplicationContext context;

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        context = applicationContext;
    }

    public static <T> T getBean(Class<T> clazz) {
        return getInstance().getBean(clazz);
    }

    public static <T> T getBean(String name, Class<T> clazz) {
        return getInstance().getBean(name, clazz);
    }

    public static <T> Map<String, T> getBeansOfType(Class<T> clazz) {
        return getInstance().getBeansOfType(clazz);
    }

    public static ApplicationContext getInstance() {<FILL_FUNCTION_BODY>}

    public static Environment getEnvironment() {
        return getInstance().getEnvironment();
    }

    public static void publishEvent(ApplicationEvent event) {
        getInstance().publishEvent(event);
    }

}

        if (Objects.isNull(context)) {
            throw new NullPointerException("ApplicationContext is null, please check if the spring container is started.");
        }
        return context;
    
<no_super_class>