Thread.currentThread().getStackTrace() will usually contain the method you’re calling it from but there are pitfalls:
Some virtual machines may, under some circumstances, omit one or more stack frames from the stack trace. In the extreme case, a virtual machine that has no stack trace information concerning this thread is permitted to return a zero-length array from this method.