private void pop(){
  String removed=encodedPathSegments.remove(encodedPathSegments.size() - 1);
  if (removed.isEmpty() && !encodedPathSegments.isEmpty()) {
    encodedPathSegments.set(encodedPathSegments.size() - 1,"");
  }
 else {
    encodedPathSegments.add("");
  }
}

private void pop ( ) { String removed = encodedPathSegments . remove ( encodedPathSegments . size ( ) - 1 ) ; if ( removed . isEmpty ( ) && ! encodedPathSegments . isEmpty ( ) ) { encodedPathSegments . set ( encodedPathSegments . size ( ) - 1 , "" ) ; } else { encodedPathSegments . add ( "" ) ; } }
removes a path segment . when this method returns the last segment is always " " , which means the encoded path will have a trailing ' / ' . < p > popping " / a / b / c / " yields " / a / b / " . in this case the list of path segments goes from [ " a " , " b " , " c " , " " ] to [ " a " , " b " , " " ] . < p > popping " / a / b / c " also yields " / a / b / " . the list of path segments goes from [ " a " , " b " , " c " ] to [ " a " , " b " , " " ] .
