public @Nullable LiveTemplateContext getLiveTemplateContext(@NotNull Class<?> clazz) {
    LiveTemplateContextsState currentState = myState;

    LiveTemplateContext existingBean = currentState.myLiveTemplateClasses.get(clazz);
    if (existingBean != null) {
      return existingBean;
    }

    for (LiveTemplateContext bean : currentState.myLiveTemplateIds.values()) {
      TemplateContextType instance = bean.getTemplateContextType();
      if (clazz.isInstance(instance)) {
        currentState.myLiveTemplateClasses.put(clazz, bean);
        return bean;
      }
    }

    return null;
  }
public @Nullable LiveTemplateContext getLiveTemplateContext(@NotNull Class<?> clazz)