private boolean isLineLastStament ( TestMethod method , int codeLineIndex ) { CodeLine codeLine = method . getCodeBody ( ) . get ( codeLineIndex ) ; if ( codeLineIndex == method . getCodeBody ( ) . size ( ) - 1 ) { return true ; } CodeLine nextCodeLine = method . getCodeBody ( ) . get ( codeLineIndex + 1 ) ; assert codeLine . getEndLine ( ) <= nextCodeLine . getStartLine ( ) ; if ( codeLine . getEndLine ( ) == nextCodeLine . getStartLine ( ) ) { // if next statement exists in the same line, // this statement is not the last statement for the line return false ; } return true ; }
This may return false since multiple statement can be found in a line .