Consider the following:
withConfig(configuration) {
imports {
star 'groovy.transform'
}
}
import groovy.transform.CompileStatic
@CompileStatic
def method() {
}
Performing the Organize Imports (Ctrl+Shift+O) action should remove the import statement. It is satisfiable from the config script star import and is not in conflict with another name source. If the import had been java.util.List, it would be removed because it is satisfiable from Groovy default imports.