class EncodedPath {

  static String prefixSuccessor(String path) {
    StringBuilder result = new StringBuilder(path);
    int pos = result.length() - 1;
    char c = result.charAt(pos);

    // TODO: this really should be a general thing, but not worth it right now
    hardAssert(c == ENCODED_SEPARATOR, "successor may only operate on paths generated by encode");
    result.setCharAt(pos, (char) ((int) c + 1));
    return result.toString();
  }

}