class ButtonFooterMixin implements Mixin {

    public void removeButton(Button button) {
        if (mButtonContainer != null) {
            mButtonContainer.removeView(button);
        }
    }

}

class ButtonFooterMixinTest {

    private Context mContext;
    private TemplateLayout mTemplateLayout;
    private FrameLayout mStubParent;
    private ViewStub mFooterStub;

    @Test
    public void testRemoveButton() {

        ButtonFooterMixin mixin = new ButtonFooterMixin(mTemplateLayout);
        final Button fooButton = mixin.addButton("foo", R.style.SuwGlifButton_Secondary);
        final Button barButton = mixin.addButton("bar", R.style.SuwGlifButton_Secondary);

        fooButton.setTag("foo");
        barButton.setTag("bar");
        assertNotNull("Foo button should exist", mStubParent.findViewWithTag("foo"));
        assertNotNull("Bar button should exist", mStubParent.findViewWithTag("bar"));

        mixin.removeButton(fooButton);

        assertNull("Foo button should be removed", mStubParent.findViewWithTag("foo"));
        assertNotNull("Bar button should not be removed", mStubParent.findViewWithTag("bar"));
    }

}