Tweet implements Identifiable { @Override public long getId() { return this.id; } private  Tweet();  Tweet(Coordinates coordinates, String createdAt, Object currentUserRetweet,
            TweetEntities entities, TweetEntities extendedEntities, Integer favoriteCount,
            boolean favorited, String filterLevel, long id, String idStr,
            String inReplyToScreenName, long inReplyToStatusId, String inReplyToStatusIdStr,
            long inReplyToUserId, String inReplyToUserIdStr, String lang, Place place,
            boolean possiblySensitive, Object scopes, long quotedStatusId, String quotedStatusIdStr,
            Tweet quotedStatus, int retweetCount, boolean retweeted, Tweet retweetedStatus,
            String source, String text, List<Integer> displayTextRange, boolean truncated,
            User user, boolean withheldCopyright, List<String> withheldInCountries,
            String withheldScope, Card card); @Override long getId(); @Override boolean equals(Object o); @Override int hashCode(); static final long INVALID_ID; @SerializedName("coordinates")
    final Coordinates coordinates; @SerializedName("created_at")
    final String createdAt; @SerializedName("current_user_retweet")
    final Object currentUserRetweet; @SerializedName("entities")
    final TweetEntities entities; @SerializedName("extended_entities")
    final TweetEntities extendedEntities; @SerializedName("favorite_count")
    final Integer favoriteCount; @SerializedName("favorited")
    final boolean favorited; @SerializedName("filter_level")
    final String filterLevel; @SerializedName("id")
    final long id; @SerializedName("id_str")
    final String idStr; @SerializedName("in_reply_to_screen_name")
    final String inReplyToScreenName; @SerializedName("in_reply_to_status_id")
    final long inReplyToStatusId; @SerializedName("in_reply_to_status_id_str")
    final String inReplyToStatusIdStr; @SerializedName("in_reply_to_user_id")
    final long inReplyToUserId; @SerializedName("in_reply_to_user_id_str")
    final String inReplyToUserIdStr; @SerializedName("lang")
    final String lang; @SerializedName("place")
    final Place place; @SerializedName("possibly_sensitive")
    final boolean possiblySensitive; @SerializedName("scopes")
    final Object scopes; @SerializedName("quoted_status_id")
    final long quotedStatusId; @SerializedName("quoted_status_id_str")
    final String quotedStatusIdStr; @SerializedName("quoted_status")
    final Tweet quotedStatus; @SerializedName("retweet_count")
    final int retweetCount; @SerializedName("retweeted")
    final boolean retweeted; @SerializedName("retweeted_status")
    final Tweet retweetedStatus; @SerializedName("source")
    final String source; @SerializedName(value = "text", alternate = {"full_text"})
    final String text; @SerializedName("display_text_range")
    final List<Integer> displayTextRange; @SerializedName("truncated")
    final boolean truncated; @SerializedName("user")
    final User user; @SerializedName("withheld_copyright")
    final boolean withheldCopyright; @SerializedName("withheld_in_countries")
    final List<String> withheldInCountries; @SerializedName("withheld_scope")
    final String withheldScope; @SerializedName("card")
    final Card card; }
@Test public void testDeserialization() throws IOException { JsonReader reader = null; try { reader = new JsonReader(new InputStreamReader(testResources .getAsStream("model_tweet.json"))); final Tweet tweet = gson.fromJson(reader, Tweet.class); assertEquals(EXPECTED_CREATED_AT, tweet.createdAt); assertNotNull(tweet.entities); assertNotNull(tweet.entities.hashtags); assertNotNull(tweet.entities.media); assertNotNull(tweet.entities.symbols); assertNotNull(tweet.entities.urls); assertNotNull(tweet.entities.userMentions); assertNotNull(tweet.user); assertTrue(tweet.retweeted); assertEquals(EXPECTED_ID, tweet.id); assertEquals(EXPECTED_ID, tweet.getId()); assertNotNull(tweet.text); assertEquals(EXPECTED_TEXT, tweet.text); assertNotNull(tweet.displayTextRange); assertFalse(tweet.truncated); assertArrayEquals(EXPECTED_DISPLAY_TEXT_RANGE, tweet.displayTextRange.toArray()); assertNotNull(tweet.withheldInCountries); assertEquals(1, tweet.withheldInCountries.size()); assertEquals(EXPECTED_WITHHELD_IN_COUNTRIES, tweet.withheldInCountries.get(0)); } finally { CommonUtils.closeQuietly(reader); } }