@Test
public void testParse() {

    //GIVEN
    List<SequenceDescriptor> expected = new ArrayList<>();
    expected.add(sequenceDescriptor);
    expected.add(sequenceDescriptor);
    dialogDescriptors = new ArrayList<>();
    given(rootElement.getElementsByTagName(SEQUENCE_DESCRIPTOR_TAG_NAME)).willReturn(nodeList);
    given(nodeList.getLength()).willReturn(2);
    given(nodeList.item(0)).willReturn(sequenceElement);
    given(nodeList.item(1)).willReturn(sequenceElement);
    given(sequenceDescriptorFactory.create(document, sequenceElement, dialogDescriptors)).willReturn(sequenceDescriptor);
    //WHEN
    List<SequenceDescriptor> result = underTest.parse(document, rootElement, dialogDescriptors);
    //THEN
    assertEquals(expected, result);
}