HorizontalDisplayLayout extends BaseServiceCustomComponent<ID, T> { @Override public void build() { HorizontalLayout layout = new DefaultHorizontalLayout(false, true); for (AttributeModel attributeModel : getEntityModel().getAttributeModels()) { if (attributeModel.isVisible() && AttributeType.BASIC.equals(attributeModel.getAttributeType())) { layout.add(constructLabel(entity, attributeModel)); } } add(layout); } HorizontalDisplayLayout(BaseService<ID, T> service, EntityModel<T> entityModel, T entity); @Override void build();  }
@Test public void test() { HorizontalDisplayLayout<Integer, TestEntity> layout = new HorizontalDisplayLayout<Integer, TestEntity>(service, entityModelFactory.getModel(TestEntity.class), e1); layout.build(); Component comp = layout.getChildren().iterator().next(); assertTrue(comp instanceof HorizontalLayout); }