This problem can arise for example in the static main method of a class.
To solve it, simply instantiate the current class from that method, and you can reference the method via the newly created object!