question: public static String extractCollectionFromPath ( String path ) { String extractedCollectionName = null ; String pathModified = removeFromEndOfString ( path , SLASH ) ; String [ ] pathSegments = pathModified . split ( "/" ) ; if ( pathSegments . length > 0 ) { extractedCollectionName = pathSegments [ pathSegments . length - 1 ] ; } return extractedCollectionName ; }
target:  Extracts the collection name from the given path. The collection name is known to be the last segment of the path