I’ve just successfully run this by checking out hbc from Github; modifying the hbc-example pom.xml to set the FilterStreamExample as the mainClass; uncommenting the main() method in FilterStreamExample.java; and running via mvn exec.
I’ve tried your version of the code as well and it works here.
Note that what this code is doing is filtering the stream for Tweets containing #yolo or twitterapi - those probably don’t happen very often, so I had to Tweet the hashtag from my test account to trigger a Tweet to arrive in the code.
You should see output similar to this:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Hosebird Client Examples 2.2.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> exec-maven-plugin:1.2.1:java (default-cli) > validate @ hbc-example >>>
[INFO]
[INFO] <<< exec-maven-plugin:1.2.1:java (default-cli) < validate @ hbc-example <<<
[INFO]
[INFO] --- exec-maven-plugin:1.2.1:java (default-cli) @ hbc-example ---
[com.twitter.hbc.example.FilterStreamExample.main()] INFO com.twitter.hbc.httpclient.BasicClient - New connection executed: hosebird-client-0, endpoint: /1.1/statuses/filter.json?delimited=length&stall_warnings=true
[hosebird-client-io-thread-0] INFO com.twitter.hbc.httpclient.ClientBase - hosebird-client-0 Establishing a connection
[hosebird-client-io-thread-0] INFO com.twitter.hbc.httpclient.ClientBase - hosebird-client-0 Processing connection data
{"created_at":"Wed Mar 22 17:29:43 +0000 2017","id":844601998863482884,"id_str":"844601998863482884","text":"testing #yolo","source":"\u003ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003eTweetDeck\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":54931584,"id_str":"54931584","name":"Evil Piper","screen_name":"evilpiper","location":null,"url":null,"description":"mwah-ha-haaaaa (aka, squirrel!)","protected":false,"verified":false,"followers_count":28,"friends_count":17,"listed_count":1,"favourites_count":30,"statuses_count":597,"created_at":"Wed Jul 08 15:40:42 +0000 2009","utc_offset":0,"time_zone":"London","geo_enabled":true,"lang":"en","contributors_enabled":false,"is_translator":false,"profile_background_color":"1A1B1F","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_link_color":"91061F","profile_sidebar_border_color":"181A1E","profile_sidebar_fill_color":"949399","profile_text_color":"120312","profile_use_background_image":false,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/307611594\/evil_normal.png","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/307611594\/evil_normal.png","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/54931584\/1400069736","default_profile":false,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place":null,"contributors":null,"is_quote_status":false,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[{"text":"yolo","indices":[8,13]}],"urls":[],"user_mentions":[],"symbols":[]},"favorited":false,"retweeted":false,"filter_level":"low","lang":"en","timestamp_ms":"1490203783132"}