LayoutBuilder { public LayoutBuilder add(Element element) { mElements.add(element); return this; }  LayoutBuilder add(Element element); LayoutBuilder add(Element element, boolean condition); void build(LinearLayout layout);  }
@Test public void addTest() { LayoutBuilder layoutBuilder = new LayoutBuilder(); InputInsulin inputInsulin = new InputInsulin(); layoutBuilder.add(inputInsulin); Assert.assertEquals(1, layoutBuilder.mElements.size()); }
@Test public void addConditionalTest() { LayoutBuilder layoutBuilder = new LayoutBuilder(); InputInsulin inputInsulin = new InputInsulin(); layoutBuilder.add(inputInsulin, true); Assert.assertEquals(1, layoutBuilder.mElements.size()); layoutBuilder.add(inputInsulin, false); Assert.assertEquals(1, layoutBuilder.mElements.size()); }