public Query query() {
        return query;
    }
@Test
    void testQuery() {
        Query query = Query.parse("foo=bar&baz", Name::of);
        Map<String, String> expected = new LinkedHashMap<>();
        expected.put("foo", "bar");
        expected.put("baz", null);
        assertEquals(expected, query.lastEntries());

        expected.remove("baz");
        assertEquals(expected, query.remove("baz").lastEntries());

        expected.put("baz", null);
        expected.remove("foo");
        assertEquals(expected, query.remove("foo").lastEntries());
        assertEquals(expected, Query.empty(Name::of).set("baz").lastEntries());

        assertEquals("query 'foo=bar&baz=bax&quu=fez&moo'",
                     query.set("baz", "bax").set(Map.of("quu", "fez")).set("moo").toString());

        Query bloated = query.add("baz", "bax").add(Map.of("quu", List.of("fez", "pop"))).add("moo").add("moo").add("foo", "bar");

        List<String> foos = new ArrayList<>(); foos.add("bar"); foos.add("bar");
        List<String> bazs = new ArrayList<>(); bazs.add(null);  bazs.add("bax");
        List<String> quus = new ArrayList<>(); quus.add("fez"); quus.add("pop");
        List<String> moos = new ArrayList<>(); moos.add(null);  moos.add(null);
        assertEquals(List.of(Map.entry("foo", foos), Map.entry("baz", bazs), Map.entry("quu", quus), Map.entry("moo", moos)),
                     new ArrayList<>(bloated.entries().entrySet()));

        Map<String, String> last = new LinkedHashMap<>();
        last.put("foo", "bar");
        last.put("baz", "bax");
        last.put("quu", "pop");
        last.put("moo", null);
        assertEquals(new ArrayList<>(last.entrySet()), new ArrayList<>(bloated.lastEntries().entrySet()));

        assertEquals("query 'foo=bar&baz&baz=bax&quu=fez&quu=pop&moo&moo&foo=bar'",
                     bloated.toString());

        assertEquals("query 'foo=bar&quu=fez&quu=pop&moo&moo&foo=bar'",
                     bloated.remove("baz").toString());

        assertEquals("query 'baz&baz=bax&quu=fez&quu=pop&moo&moo'",
                     bloated.remove("foo").toString());

        assertEquals("query 'foo=bar&baz&baz=bax&quu=fez&quu=pop&foo=bar&moo'",
                     bloated.set("moo").toString());

        assertEquals("no query",
                     bloated.remove(last.keySet()).toString());

        assertThrows(NullPointerException.class,
                     () -> query.remove((String) null));

        assertThrows(NullPointerException.class,
                     () -> query.add((String) null));

        assertThrows(NullPointerException.class,
                     () -> query.add(null, "hax"));

        assertThrows(NullPointerException.class,
                     () -> query.add("hax", null));

        Map<String, String> names = new LinkedHashMap<>();
        names.put(null, "hax");
        assertThrows(NullPointerException.class,
                     () -> query.set(names));
    }