Here you can find the source of lock(Lock lock)
private static void lock(Lock lock)
//package com.java2s; /*/*ww w . j a v a 2s . com*/ * Copyright 2015, Yahoo Inc. * Copyrights licensed under the New BSD License. * See the accompanying LICENSE file for terms. */ import java.util.concurrent.locks.Lock; public class Main { private static void lock(Lock lock) { if (lock != null) { lock.lock(); } } }