public NamePath withoutHead(){
  List<String> newPathPieces=new ArrayList<>();
  newPathPieces.addAll(pathPieces);
  if (!newPathPieces.isEmpty()) {
    newPathPieces.remove(newPathPieces.size() - 1);
  }
  return new NamePath(newPathPieces);
}

public NamePath withoutHead ( ) { List < String > newPathPieces = new ArrayList < > ( ) ; newPathPieces . addAll ( pathPieces ) ; if ( ! newPathPieces . isEmpty ( ) ) { newPathPieces . remove ( newPathPieces . size ( ) - 1 ) ; } return new NamePath ( newPathPieces ) ; }
create a new namepath where the head ( the last piece ) is removed . if there is no last piece this will return a new empty namepath .
