This is what I had in mind:
```
if (isAllSuitableNodesOffline(build)) {
    Label label = getAssignedLabel();
    Collection<Cloud> applicableClouds = label == null
        ? Jenkins.getInstance().clouds
        : label.getClouds()
    ;

    return applicableClouds.isEmpty()
        ? WorkspaceOfflineReason.all_suitable_nodes_are_offline
        : WorkspaceOfflineReason.use_ondemand_slave
    ;
}
```