question: public NamePath withoutHead ( ) { List < String > newPathPieces = new ArrayList < > ( ) ; newPathPieces . addAll ( pathPieces ) ; if ( ! newPathPieces . isEmpty ( ) ) { newPathPieces . remove ( newPathPieces . size ( ) - 1 ) ; } return new NamePath ( newPathPieces ) ; }
target:  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.