public static PsiElement findParentContextOfClass(PsiElement element, Class<?> aClass, boolean strict){
    PsiElement scope = strict ? element.getContext() : element;
    while(scope != null && !aClass.isInstance(scope)){
      scope = scope.getContext();
    }
    return scope;
  }
public static PsiElement findParentContextOfClass(PsiElement element, Class<?> aClass, boolean strict)