public synchronized void setTasks(List<Class<? extends Task>> tasks) { if (locked) throw new UnsupportedOperationException(); if (tasks == null) throw new NullPointerException(); this.tasks = Collections.unmodifiableList(tasks); }
public List<Command> getCommands() { synchronized (commands) { return Collections.unmodifiableList(commands); } }