private static boolean isSystemErrOrOutUse(PsiExpression resourceCreationExpression) {
    if (!(resourceCreationExpression instanceof PsiMethodCallExpression methodCallExpression)) {
      return false;
    }
    final PsiReferenceExpression methodExpression = methodCallExpression.getMethodExpression();
    final PsiExpression qualifierExpression = methodExpression.getQualifierExpression();
    if (qualifierExpression instanceof PsiReferenceExpression referenceExpression) {
      final PsiElement target = referenceExpression.resolve();
      if (target instanceof PsiField field) {
        final String fieldName = field.getName();
        if ("out".equals(fieldName) || "err".equals(fieldName)) {
          final PsiClass containingClass = field.getContainingClass();
          if (containingClass != null && "java.lang.System".equals(containingClass.getQualifiedName())) {
            return true;
          }
        }
      }
    }
    return false;
  }
private static boolean isSystemErrOrOutUse(PsiExpression resourceCreationExpression)