Splunk interview question

Implement Lock in JDK