@Test
public void testParseNodesOfElement() {

    //GIVEN
    List<ConditionDescriptor> expected = new ArrayList<>();
    expected.add(conditionDescriptor);
    expected.add(conditionDescriptor);
    given(element.getElementsByTagName(ConditionDescriptor.TAG_NAME)).willReturn(nodeList);
    given(nodeList.getLength()).willReturn(2);
    given(nodeList.item(0)).willReturn(conditionDescriptorElement);
    given(nodeList.item(1)).willReturn(conditionDescriptorElement);
    given(conditionDescriptorParser.parseNode(conditionDescriptorElement, document)).willReturn(conditionDescriptor);
    //WHEN
    List<ConditionDescriptor> result = underTest.parseNodesOfElement(document, element);
    //THEN
    assertEquals(expected, result);
}