private static int getOffsetInMethod(@NotNull PsiElement member) {
    if (member instanceof PsiMethod method) {
      PsiCodeBlock body = method.getBody();
      if (body == null) {
        return method.getTextRange().getStartOffset();
      }
      PsiJavaToken lBrace = body.getLBrace();
      assert lBrace != null : member.getText();
      return lBrace.getTextRange().getEndOffset();
    }
    return member.getTextRange().getStartOffset();
  }
private static int getOffsetInMethod(@NotNull PsiElement member)