@Test
public void testClear() {

    AttributeContext context = new BasicAttributeContext();
    context.putAttribute("name1", new Attribute("value1"), false);
    context.putAttribute("name2", new Attribute("value2"), true);
    context.clear();
    Set<String> names = context.getLocalAttributeNames();
    assertTrue("There are local attributes", names == null
            || names.isEmpty());
    names = context.getCascadedAttributeNames();
    assertTrue("There are cascaded attributes", names == null
            || names.isEmpty());
}