private static boolean isInInitializer(PsiElement call) {
      final PsiMethod method = PsiTreeUtil.getParentOfType(call, PsiMethod.class, true, PsiClass.class, PsiLambdaExpression.class);
      if (method != null) {
        return method.isConstructor();
      }
      final PsiField field = PsiTreeUtil.getParentOfType(call, PsiField.class, true, PsiClass.class);
      if (field != null) {
        return true;
      }
      final PsiClassInitializer classInitializer = PsiTreeUtil.getParentOfType(call, PsiClassInitializer.class, true, PsiClass.class);
      return classInitializer != null && !classInitializer.hasModifierProperty(PsiModifier.STATIC);
    }
private static boolean isInInitializer(PsiElement call)