@Test
public void testSetPrimaryColor() {

    GlifLayout layout = new GlifLayout(mContext);
    layout.setProgressBarShown(true);
    layout.setPrimaryColor(ColorStateList.valueOf(Color.RED));
    assertEquals("Primary color should be red",
            ColorStateList.valueOf(Color.RED), layout.getPrimaryColor());
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        ProgressBar progressBar = (ProgressBar) layout.findViewById(R.id.suw_layout_progress);
        assertEquals("Progress bar should be tinted red",
                ColorStateList.valueOf(Color.RED), progressBar.getIndeterminateTintList());
        assertEquals("Determinate progress bar should also be tinted red",
                ColorStateList.valueOf(Color.RED), progressBar.getProgressBackgroundTintList());
    }
}