@Test
public void should_generate_title_and_table_widgets_pattern_when_node_is_read() {

    BusinessObjectContainer boc = new BusinessObjectContainer();
    BusinessDataToWidgetMapper businessDataToWidgetMapper = makeBusinessDataToWidgetMapper(boc);
    NodeBusinessObjectInput node = new NodeBusinessObjectInput("com.company.model.person", "person");
    node.addInput(aContractInput("addresses").mulitple().withType(String.class.getName()).build());
    node.addInput(aContractInput("firstName").withType(String.class.getName()).build());
    node.addInput(aContractInput("lastName").withType(String.class.getName()).build());
    businessDataToWidgetMapper.generateMasterDetailsPattern(node, boc.getContainer().getRows());
    Component title = (Component) boc.getContainer().getRows().get(0).get(0);
    assertThat(title.getId()).isEqualTo("pbTitle");
    PropertyValue titleCollectionPropertyValue = title.getPropertyValues().get("text");
    assertThat(titleCollectionPropertyValue.getType()).isEqualTo("interpolation");
    assertThat(titleCollectionPropertyValue.getValue()).isEqualTo("Person");
    Component tableWidget = (Component) boc.getContainer().getRows().get(1).get(0);
    assertThat(tableWidget.getId()).isEqualTo("pbTable");
    Map<String, Variable> variables = boc.getBusinessObjectVariable();
    assertThat(variables.size()).isEqualTo(1);
    assertThat(variables.get("person_selected")).isNotNull();
}