question: public static int countEmojis ( String text ) { String htmlifiedText = htmlify ( text ) ; Matcher matcher = htmlEntityPattern . matcher ( htmlifiedText ) ; int counter = 0 ; while ( matcher . find ( ) ) { String emojiCode = matcher . group ( ) ; if ( isEmoji ( emojiCode ) ) { counter ++ ; } } return counter ; }
target:  Counts valid emojis passed string