package ee.shy.core;

import org.apache.commons.lang3.ArrayUtils;

import java.util.ArrayList;
import java.util.List;

public class TreePath implements Comparable<TreePath> {
    private final String[] pathStrings;

    public TreePath(String stringPath) {
        pathStrings = stringPath.split("/");
    }

    public TreePath(String[] treePath) {
        this.pathStrings = treePath;
    }

    public TreePath resolve(String str) {
        return new TreePath(ArrayUtils.addAll(pathStrings, str.split("/")));
    }

    public String toString() {
        return String.join("/", pathStrings);
    }

    @Override
    public int compareTo(TreePath o) {
        String[] oStringList = o.pathStrings;

        int iterCount = Math.min(pathStrings.length, oStringList.length);
        
        for (int i = 0; i < iterCount; i++) {
            int strCompareResult = oStringList[i].compareTo(pathStrings[i]);
            if(strCompareResult != 0) {
                return strCompareResult;
            }
        }

        return oStringList.length - pathStrings.length;
    }
}

@@ -213,101 +213,8 @@
 s;%0A%0A
-    public TreePath(String stringPath) %7B%0A        pathStrings = stringPath.split(%22/%22);%0A    %7D%0A%0A
     
@@ -395,16 +395,34 @@
 trings, 
+ArrayUtils.remove(
 str.spli
@@ -427,16 +427,20 @@
 lit(%22/%22)
+, 0)
 ));%0A    

Remove String constructor from TreePath