ColoredHeaderMixin extends HeaderMixin { public ColorStateList getColor() { final TextView titleView = getTextView(); return titleView != null ? titleView.getTextColors() : null; } ColoredHeaderMixin(TemplateLayout layout, AttributeSet attrs, int defStyleAttr); void setColor(ColorStateList color); ColorStateList getColor();  }
@Test public void testGetColor() { ColoredHeaderMixin mixin = new ColoredHeaderMixin(mTemplateLayout, null, 0); mHeaderTextView.setTextColor(ColorStateList.valueOf(Color.GREEN)); assertEquals(ColorStateList.valueOf(Color.GREEN), mixin.getColor()); }