Undo settings from previous closure

This is not so much a Gradle or Spotless question, as a Groovy question, but maybe someone can help.

I’d like to use a custom JavaPlugin that contains built-in spotless settings that I would like to override. E.g.:

project.with {
    spotless {
        java {
            // some built-in settings that I'd like to override
        }
    }
}

Short of changing the plugin that does this, is there some Groovy magic that can help me here? I tried putting my desired settings in a separate closure, but my (uninformed) understanding is that the new closure would be processed in addition to, as opposed to instead of, the existing one.

You could poke through the spotless docs to see the available methods on the extension object. But typically there will be “adder” methods which are cumulative and “setters” which will override. Eg:

spotless {
   java {
      srcDir 'foo' // adder/cumulative 
      srcDir 'bar' // adder/cumulative 
      srcDirs = ['baz'] // setter/override
   } 
}