question: public static Optional < String > packageName ( String longName ) { if ( longName . contains ( DOT ) ) { return Optional . of ( longName . substring ( 0 , longName . lastIndexOf ( DOT ) ) ) ; } else { return Optional . empty ( ) ; } }
target:  Returns the 'package' part of a long name. This is everything before the last dot.