ProgressBarMixin implements Mixin { public ProgressBar peekProgressBar() { return (ProgressBar) mTemplateLayout.findManagedViewById(R.id.suw_layout_progress); } ProgressBarMixin(TemplateLayout layout); boolean isShown(); void setShown(boolean shown); ProgressBar peekProgressBar(); void setColor(@Nullable ColorStateList color); @Nullable ColorStateList getColor();  }
@Test public void testPeekProgressBar() { ProgressBarMixin mixin = new ProgressBarMixin(mTemplateLayout); assertNull("PeekProgressBar should return null when stub not inflated yet", mixin.peekProgressBar()); mixin.setShown(true); assertNotNull("PeekProgressBar should be available after setting to shown", mixin.peekProgressBar()); }