final Cluster cluster = this.clusterRepo.findOne(id);
if (cluster != null) {
for (final Command detached : commands) {
final Command cmd = this.commandRepo.findOne(detached.getId());
if (cmd != null) {
cluster.addCommand(cmd);
} else {
throw new GenieNotFoundException("No command with id " + detached.getId() + " exists.");
}
}
return cluster.getCommands();