### Question:
ButtonFooterMixin implements Mixin { public View addSpace() { final LinearLayout buttonContainer = ensureFooterInflated(); View space = new View(buttonContainer.getContext()); space.setLayoutParams(new LayoutParams(0, 0, 1.0f)); space.setVisibility(View.INVISIBLE); buttonContainer.addView(space); return space; } ButtonFooterMixin(TemplateLayout layout); Button addButton(CharSequence text, @StyleRes int theme); Button addButton(@StringRes int text, @StyleRes int theme); Button addButton(Button button); View addSpace(); void removeButton(Button button); void removeSpace(View space); void removeAllViews();  }### Answer:
@Test public void testAddSpace() { ButtonFooterMixin mixin = new ButtonFooterMixin(mTemplateLayout); mixin.addButton("foo", R.style.SuwGlifButton_Secondary); final View space = mixin.addSpace(); mixin.addButton("bar", R.style.SuwGlifButton_Primary); space.setTag("space"); assertNotNull(mStubParent.findViewWithTag("space")); assertEquals("Space should have weight of 1", 1f, ((LinearLayout.LayoutParams) space.getLayoutParams()).weight, 0.001); }
@Test public void testAddSpace() { ButtonFooterMixin mixin = new ButtonFooterMixin(mTemplateLayout); mixin.addButton("foo", R.style.SuwGlifButton_Secondary); final View space = mixin.addSpace(); mixin.addButton("bar", R.style.SuwGlifButton_Primary); space.setTag("space"); assertNotNull(mStubParent.findViewWithTag("space")); assertEquals( "Space should have weight of 1", 1f, ((LinearLayout.LayoutParams) space.getLayoutParams()).weight, 0.001); }