question: private static int convertToInt ( String value , int defaultValue ) { String trim = value . trim ( ) ; if ( trim . length ( ) == 0 ) { return defaultValue ; } return Integer . parseInt ( trim ) ; }
target:  Convert a string to an int treating empty strings as the default value.