@Override
    public <V> MultiLabel generateOutput(V label) {
        if (label instanceof Collection) {
            Collection<?> c = (Collection<?>) label;
            List<Pair<String,Boolean>> dimensions = new ArrayList<>();
            for (Object o : c) {
                dimensions.add(MultiLabel.parseElement(o.toString()));
            }
            return MultiLabel.createFromPairList(dimensions);
        }
        return MultiLabel.parseString(label.toString());
    }
@Test
    public void testGenerateOutput_str() {
        MultiLabelFactory factory = new MultiLabelFactory();
        MultiLabel output = factory.generateOutput("a=true,b=true,c=true");
        assertEquals(3, output.getLabelSet().size());
        assertEquals("a,b,c", output.getLabelString());

        output = factory.generateOutput("a,b,c");
        assertEquals(3, output.getLabelSet().size());
        assertEquals("a,b,c", output.getLabelString());

        output = factory.generateOutput("a,b");
        assertEquals(2, output.getLabelSet().size());
        assertEquals("a,b", output.getLabelString());

        output = factory.generateOutput("a");
        assertEquals(1, output.getLabelSet().size());
        assertEquals("a", output.getLabelString());

        //
        // Boolean.parseBoolean("integer") resolves to false.
        output = factory.generateOutput("a=1,b=1,c=0");
        assertEquals(0, output.getLabelSet().size());
        assertEquals("", output.getLabelString());
    }