question: public static String extractDefaultMajorVersionFromRestName ( String restName ) { Preconditions . checkNotNull ( restName ) ; String [ ] segs = restName . split ( "\\." ) ; if ( segs . length == 0 ) { return "v1" ; } Matcher matcher = MAJOR_VERSION_REGEX_PATTERN . matcher ( segs [ 0 ] ) ; return matcher . find ( ) ? matcher . group ( 1 ) : "v1" ; }
target:  Extract major version from REST element name. Rest element name has the form of "v1.foo.bar" or "foo.bar". For the later case, "v1" will be returned.