ViewGroupColorAdapter implements ColorAdapter<ViewGroup> { @Override public void applyColor(ViewGroup view, @ColorInt int color) { view.setBackgroundColor(color); }  @Override void applyColor(ViewGroup view, @ColorInt int color); @Override int getColor(ViewGroup view);  }
@Test public void applyColor() throws Exception { int color = Color.GREEN; adapter.applyColor(view, color); Drawable bg = view.getBackground(); assertTrue(bg instanceof ColorDrawable); ColorDrawable cbg = (ColorDrawable) bg; assertThat(cbg.getColor(), is(color)); }