TaskManager { public Task<T> startTask(Callable<T> callable, String name) { return startTask(callable, name, null, null); } TaskManager();  TaskManager(ExecutorService executorService);  TaskManager(ExecutorService executorService, boolean usingEventQueue); void startUp(); void shutDown(); State getState(); Task<T> startTask(Callable<T> callable, String name); Task<T> startTask(Callable<T> callable, String name, String description); Task<T> startTask(Callable<T> callable, String name, String description, Map<String, String> metaData); int getNumberOfTasks(); Task<T> getTaskById(long taskId); Task<T> getTaskByCallable(Callable<T> callable); Map<Long, Task<T>> getTasks(); boolean isUsingEventQueue(); void setUsingEventQueue(boolean usingEventQueue); void addTaskListener(TaskListener<T> listener); void removeTaskListener(TaskListener<T> listener);  }
@Test(expected = IllegalStateException.class) public void notRunning() { instance.startTask(() -> null, "Won't work"); }