code: public static void main(String[] args) throws TwitterException {
          TwitterStream twitterStream = new TwitterStreamFactory().getInstance().addListener(new StatusListener() {
              @Override
              public void onStatus(Status status) {
                  System.out.println("@" + status.getUser().getScreenName() + " - " + status.getText());
              }
  
              @Override
              public void onDeletionNotice(StatusDeletionNotice statusDeletionNotice) {
                  System.out.println("Got a status deletion notice id:" + statusDeletionNotice.getStatusId());
              }
  
              @Override
              public void onTrackLimitationNotice(int numberOfLimitedStatuses) {
                  System.out.println("Got track limitation notice:" + numberOfLimitedStatuses);
              }
  
              @Override
              public void onScrubGeo(long userId, long upToStatusId) {
                  System.out.println("Got scrub_geo event userId:" + userId + " upToStatusId:" + upToStatusId);
              }
  
              @Override
              public void onStallWarning(StallWarning warning) {
                  System.out.println("Got stall warning:" + warning);
              }
  
              @Override
              public void onException(Exception ex) {
                  ex.printStackTrace();
              }
          }).firehose(0);
      }
docs: Main entry of this application.
  
  @param args arguments doesn't take effect with this example
  @throws TwitterException when Twitter service or network is unavailable