@SuppressWarnings("ResourceType")  // Needed to create attribute set from layout XML.
@Test
public void testSetTextFromXml() throws IOException, XmlPullParserException {

    final XmlResourceParser parser =
            mContext.getResources().getXml(R.layout.test_mixin_attributes);
    while (!TemplateLayout.class.getName().equals(parser.getName())) {
        parser.next();
    }
    new HeaderMixin(mTemplateLayout, Xml.asAttributeSet(parser), 0);
    assertEquals("lorem ipsum", mHeaderTextView.getText());
}