// Path: sorter/src/main/java/sortpom/wrapper/ElementUtil.java
// static String getDeepName(final Element element) {
//     if (element == null) {
//         return "";
//     }
//     return getDeepName(element.getParentElement()) + '/' + element.getName();
// }


import org.jdom.Element;
import java.util.HashMap;
import java.util.Map;
import static sortpom.wrapper.ElementUtil.getDeepName;
package sortpom.wrapper;




/**
 * All elements from the chosen sort order (from predefined sort order or custom sort order) are placed in this map
 * along with an index that describes in which order the elements should be sorted.
 */
class ElementSortOrderMap {
    /** Contains sort order element names and their index. */
    private final Map<String, Integer> elementNameSortOrderMap = new HashMap<>();

    /**
     * Add an Xml element to the map
     *
     * @param element   Xml element
     * @param sortOrder an index describing the sort order (lower number == element towards the start of the file)
     */
    public void addElement(Element element, int sortOrder) {
// Path: sorter/src/main/java/sortpom/wrapper/ElementUtil.java
// static String getDeepName(final Element element) {
//     if (element == null) {
//         return "";
//     }
//     return getDeepName(element.getParentElement()) + '/' + element.getName();
// }


// Path: sorter/src/main/java/sortpom/wrapper/ElementSortOrderMap.java
import org.jdom.Element;
import java.util.HashMap;
import java.util.Map;
import static sortpom.wrapper.ElementUtil.getDeepName;

package sortpom.wrapper;




/**
 * All elements from the chosen sort order (from predefined sort order or custom sort order) are placed in this map
 * along with an index that describes in which order the elements should be sorted.
 */
class ElementSortOrderMap {
    /** Contains sort order element names and their index. */
    private final Map<String, Integer> elementNameSortOrderMap = new HashMap<>();

    /**
     * Add an Xml element to the map
     *
     * @param element   Xml element
     * @param sortOrder an index describing the sort order (lower number == element towards the start of the file)
     */
    public void addElement(Element element, int sortOrder) {
        final String deepName = getDeepName(element);