ElementUtil { static boolean isElementParentName(Element element, String name) { Element parent = element.getParentElement(); if (parent == null) { return false; } return isElementName(parent, name); } private  ElementUtil();   }
@Test void parentElementNameShouldBeMatched() { assertThat(ElementUtil.isElementParentName(child, "Parent"), is(true)); assertThat(ElementUtil.isElementParentName(child, "Gurka"), is(false)); assertThat(ElementUtil.isElementParentName(parent, "Parent"), is(false)); }