public void addTask(Task task) {
        tasks.add(requireNonNull(task));
    }
@Test
    void addsATaskServlet() throws Exception {
        final Task task = new Task("thing") {
            @Override
            public void execute(Map<String, List<String>> parameters, PrintWriter output) throws Exception {
            }
        };
        env.addTask(task);

        handler.setServer(new Server());
        handler.start();

        final ServletRegistration registration = handler.getServletHandler()
                                                        .getServletContext()
                                                        .getServletRegistration("tasks");
        assertThat(registration.getMappings())
                .containsOnly("/tasks/*");
    }