The Lock interface itself does not provide such functionality, but its general constructor, ReentrantLock has this method: ReentrantLock.isHeldByCurrentThread() .
Please note, however, as indicated in the documentation, the main purpose of this method is to debug, approve, and test. If you need it for normal program logic, then perhaps there is a better solution.
source share