AttributesStatement extends StatementsContainer { public void processAttributes(AnyElement element, Collection<PropertyBase> componentAttributes) { this.componentAttributes = componentAttributes; Set<String> processedAttributes = Sets.newHashSet(); TreeSet<PassThrough> passThroughAttributes = Sets.newTreeSet(); this.elementName = element.getName(); processRegularAttributes(element, processedAttributes, passThroughAttributes); String passThrough = element.getPassThrough(); processPassThrough(processedAttributes, passThroughAttributes, passThrough); String passThroughWithExclusions = element.getPassThroughWithExclusions(); processPassThroughWithExclusions(processedAttributes, passThroughAttributes, passThroughWithExclusions); if (!passThroughAttributes.isEmpty()) { WriteAttributesSetStatement writeAttributesSetStatement = passThroughStatementProvider.get(); addStatement(writeAttributesSetStatement); writeAttributesSetStatement.setAttributes(passThroughAttributes); } } @Inject  AttributesStatement(@Named(Template.XHTML_EL_NAMESPACE) Schema attributesSchema,
            Provider<WriteAttributeStatement> attributeStatementProvider,
            Provider<WriteAttributesSetStatement> passThroughStatementProvider, Logger logger); void processAttributes(AnyElement element, Collection<PropertyBase> componentAttributes);  }
@Test public void testProcessSimpleHtmlAttribute() throws Exception { expect(parser.parse(eq("header"), isA(WriteAttributeStatement.class), same(TypesFactory.OBJECT_TYPE))).andReturn( parsedExpression); parsedExpression.setParent(isA(WriteAttributeStatement.class)); expectLastCall(); processAttributes("div", "id", "header"); assertEquals(1, statement.getStatements().size()); assertThat(statement.getStatements().get(0), instanceOf(WriteAttributeStatement.class)); }