public Map<String, List<Host>> groups() {
        return this.groups(HostFilter.NONE);
    }
@Test
    public void testGroups() {
        final AbstractHostCollection c = new AbstractHostCollection() {
        };
        final Host bookmarkGroupa1 = new Host(new TestProtocol(), "h", new Credentials("u"));
        bookmarkGroupa1.setLabels(Collections.singleton("a"));
        final Host bookmarkGroupA1 = new Host(new TestProtocol(), "h", new Credentials("u"));
        bookmarkGroupA1.setLabels(Collections.singleton("A"));
        bookmarkGroupA1.setNickname("a");
        final Host bookmarkGroupA2 = new Host(new TestProtocol(), "h", new Credentials("u"));
        bookmarkGroupA2.setLabels(Collections.singleton("A"));
        bookmarkGroupA2.setNickname("b");
        final Host bookmarkGroupB = new Host(new TestProtocol(), "h", new Credentials("u"));
        bookmarkGroupB.setLabels(Collections.singleton("B"));
        c.add(bookmarkGroupa1);
        c.add(bookmarkGroupB);
        c.add(bookmarkGroupA2);
        c.add(bookmarkGroupA1);
        final Map<String, List<Host>> groups = c.groups();
        assertEquals("a", groups.keySet().toArray()[0]);
        assertEquals("A", groups.keySet().toArray()[1]);
        assertEquals("a", groups.get("A").toArray(new Host[0])[0].getNickname());
        assertEquals("b", groups.get("A").toArray(new Host[0])[1].getNickname());
        assertEquals("B", groups.keySet().toArray()[2]);
    }