Button second = new Button("Second layout");
first.setId("FirstButton");
second.setId("SecondButton");
buttonBar.addComponent(first);
buttonBar.addComponent(second);
mainLayout.addComponent(buttonBar);
final HorizontalLayout firstLayout = buildTestLayout(true);
final HorizontalLayout secondLayout = buildTestLayout(false);
mainLayout.addComponent(firstLayout);