public Comment removeComment ( final long commentId ) { Comment removedComment = null ; if ( comments != null ) { for ( int index = comments . size ( ) - 1 ; index >= 0 ; -- index ) { Comment currentComment = comments . get ( index ) ; if ( currentComment . getId ( ) == commentId ) { removedComment = comments . remove ( index ) ; break ; } } } return removedComment ; }
Removes the Comment specified by the commentId .