question: protected boolean attemptToAddWord ( Word word ) { double additionalLength = word . getWordWidth ( ) ; additionalLength += ! words . isEmpty ( ) ? spaceSize : 0 ; if ( currentLineLength + additionalLength <= maxLength || maxLength == - 1 ) { words . add ( word ) ; currentLineLength += additionalLength ; return true ; } else { return false ; } }
target:  Attempt to add a word to the line. If the line can fit the word in without reaching the maximum line length then the word is added and the line length increased.