assertEquals(3, specAttr.getAttributeCount());
assertSpec(spec, ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, new char[] {' '});
Object contentModel = specAttr.getAttribute(StyleConstants.ModelAttribute);
assertNotNull(contentModel);
assertTrue(contentModel instanceof FormFieldsetModel);
FormFieldsetModel fieldSet = (FormFieldsetModel)contentModel;
assertNull(fieldSet.getLegend());
assertNull(fieldSet.getLegendAttributes());
action.start(Tag.LEGEND, legendAttr1);
reader.handleText(text1.toCharArray(), 0);
action.end(Tag.LEGEND);
assertEquals(text1, fieldSet.getLegend());
assertNotNull(fieldSet.getLegendAttributes());
assertEquals(2, fieldSet.getLegendAttributes().getAttributeCount());
checkAttributes(fieldSet.getLegendAttributes(), "bbbb", "aaaa");
checkAttributes(fieldSet.getLegendAttributes(), StyleConstants.NameAttribute, Tag.LEGEND);
assertNotSame(legendAttr1, fieldSet.getLegendAttributes());
action.start(Tag.LEGEND, legendAttr2);
reader.handleText(text2.toCharArray(), 0);
action.end(Tag.LEGEND);
assertEquals(text1, fieldSet.getLegend());
assertNotNull(fieldSet.getLegendAttributes());
assertEquals(2, fieldSet.getLegendAttributes().getAttributeCount());
checkAttributes(fieldSet.getLegendAttributes(), StyleConstants.NameAttribute, Tag.LEGEND);
checkAttributes(fieldSet.getLegendAttributes(), "bbbb", "aaaa");
}