@Test
public void testCreate() {

    //GIVEN
    List<ConditionDescriptor> conditionDescriptors = new ArrayList<>();
    List<DialogDescriptor> sequenceDialogDescriptors = new ArrayList<>();
    Map<String, DialogDescriptor> nameToDialogDescriptor = new HashMap<>();
    DummySequenceHandler dummySequenceHandler = new DummySequenceHandler();
    SequenceDescriptorAttributes sequenceDescriptorAttributes = new SequenceDescriptorAttributes.Builder().name("bob")
            .handler(dummySequenceHandler).defaultTimeout(1L).build();
    given(conditionDescriptorNodesParser.parseNodesOfElement(document, sequenceElement)).willReturn(conditionDescriptors);
    given(dialogDescriptorMapper.groupByName(dialogDescriptors)).willReturn(nameToDialogDescriptor);
    given(dialogDescriptorReferenceParser.parse(sequenceElement, nameToDialogDescriptor)).willReturn(sequenceDialogDescriptors);
    given(sequenceDescriptorAttributesParser.parseNode(sequenceElement, document)).willReturn(sequenceDescriptorAttributes);
    //WHEN
    SequenceDescriptor result = underTest.create(document, sequenceElement, dialogDescriptors);
    //THEN
    assertEquals(conditionDescriptors, result.getConditionDescriptors());
    assertEquals(sequenceDialogDescriptors, result.getDialogDescriptors());
    assertEquals(1L, result.getDefaultTimeout());
    assertEquals(dummySequenceHandler, result.getHandler());
    assertEquals("bob", result.getName());
}