class LockUtil {

    public static void releaseLock(Lock lockImpl, String lock, String token, Logger log){
        if(lockImpl == null){
            log.info("No lock implementation defined, going to pretend like we released the lock");
            return;
        }
        log.debug("Trying to release lock '"+lock+"' with token '"+token+"'");
        lockImpl.releaseLock(lock, token).setHandler(releaseEvent -> {
            if(releaseEvent.succeeded()){
                if(releaseEvent.result()){
                    log.debug("Released lock '"+lock+"' with token '"+token+"'");
                }
            } else {
                log.error("Could not release lock '"+lock+"'. Message: " + releaseEvent.cause().getMessage());
            }
        });
    }

    private  LockUtil();

}