I have a method which creates the lock.
ReadWriteLock lock = new ReentrantReadWriteLock();
Then I pass this object into a method using Lock Interface.
method(Lock lock)
inside the method I just do the following.
final ReentrantReadWriteLock currentLock = (ReentrantReadWriteLock) lock;
A ReentrantReadWriteLock is not a Lock. It contains two related Locks a read lock and a write lock. You can pass either of these but you can't get the original ReentrantReadWriteLock back.