We should just use `if (lock == null && ...)` rather than `GroovyJavaMethods.truth`. If we really need `truth` then `JavaGroovyEquivalents.groovyTruth` saves us calling out to groovy code.

But this doesn't relate to a change you've made in this PR...