code: public int comparePath(String[] otherPath) {
          if (path == null)
              return -1;
          else if (otherPath == null)
              return 1;
  
          int minLen = (path.length < otherPath.length) ? path.length : otherPath.length;
  
          for (int i = 0; i < minLen; i++) {
              int result = path[i].compareTo(otherPath[i]);
              if (result != 0)
                  return result;
          }
  
          return path.length - otherPath.length;
      }
docs: Returns 0 if exactly same