User implements Serializable, Identifiable { @Override public long getId() { return this.id; } User(boolean contributorsEnabled, String createdAt, boolean defaultProfile,
            boolean defaultProfileImage, String description, String emailAddress,
            UserEntities entities, int favouritesCount, boolean followRequestSent,
            int followersCount, int friendsCount, boolean geoEnabled, long id, String idStr,
            boolean isTranslator, String lang, int listedCount, String location, String name,
            String profileBackgroundColor, String profileBackgroundImageUrl,
            String profileBackgroundImageUrlHttps, boolean profileBackgroundTile,
            String profileBannerUrl, String profileImageUrl, String profileImageUrlHttps,
            String profileLinkColor, String profileSidebarBorderColor,
            String profileSidebarFillColor, String profileTextColor,
            boolean profileUseBackgroundImage, boolean protectedUser, String screenName,
            boolean showAllInlineMedia, Tweet status, int statusesCount, String timeZone,
            String url, int utcOffset, boolean verified, List<String> withheldInCountries,
            String withheldScope); @Override long getId(); static final long INVALID_ID; @SerializedName("contributors_enabled")
    final boolean contributorsEnabled; @SerializedName("created_at")
    final String createdAt; @SerializedName("default_profile")
    final boolean defaultProfile; @SerializedName("default_profile_image")
    final boolean defaultProfileImage; @SerializedName("description")
    final String description; @SerializedName("email")
    final String email; @SerializedName("entities")
    final UserEntities entities; @SerializedName("favourites_count")
    final int favouritesCount; @SerializedName("follow_request_sent")
    final boolean followRequestSent; @SerializedName("followers_count")
    final int followersCount; @SerializedName("friends_count")
    final int friendsCount; @SerializedName("geo_enabled")
    final boolean geoEnabled; @SerializedName("id")
    final long id; @SerializedName("id_str")
    final String idStr; @SerializedName("is_translator")
    final boolean isTranslator; @SerializedName("lang")
    final String lang; @SerializedName("listed_count")
    final int listedCount; @SerializedName("location")
    final String location; @SerializedName("name")
    final String name; @SerializedName("profile_background_color")
    final String profileBackgroundColor; @SerializedName("profile_background_image_url")
    final String profileBackgroundImageUrl; @SerializedName("profile_background_image_url_https")
    final String profileBackgroundImageUrlHttps; @SerializedName("profile_background_tile")
    final boolean profileBackgroundTile; @SerializedName("profile_banner_url")
    final String profileBannerUrl; @SerializedName("profile_image_url")
    final String profileImageUrl; @SerializedName("profile_image_url_https")
    final String profileImageUrlHttps; @SerializedName("profile_link_color")
    final String profileLinkColor; @SerializedName("profile_sidebar_border_color")
    final String profileSidebarBorderColor; @SerializedName("profile_sidebar_fill_color")
    final String profileSidebarFillColor; @SerializedName("profile_text_color")
    final String profileTextColor; @SerializedName("profile_use_background_image")
    final boolean profileUseBackgroundImage; @SerializedName("protected")
    final boolean protectedUser; @SerializedName("screen_name")
    final String screenName; @SerializedName("show_all_inline_media")
    final boolean showAllInlineMedia; @SerializedName("status")
    final Tweet status; @SerializedName("statuses_count")
    final int statusesCount; @SerializedName("time_zone")
    final String timeZone; @SerializedName("url")
    final String url; @SerializedName("utc_offset")
    final int utcOffset; @SerializedName("verified")
    final boolean verified; @SerializedName("withheld_in_countries")
    final List<String> withheldInCountries; @SerializedName("withheld_scope")
    final String withheldScope; }
@Test public void testDeserialization() throws IOException { JsonReader reader = null; try { reader = new JsonReader(new InputStreamReader(testResources .getAsStream("model_user.json"))); final User user = gson.fromJson(reader, User.class); assertEquals(EXPECTED_ID, user.id); assertEquals(EXPECTED_ID, user.getId()); assertEquals(EXPECTED_NAME, user.name); assertTrue(user.entities.url.urls.size() > 0); assertTrue(user.entities.description.urls.isEmpty()); assertEquals(EXPECTED_SCREEN_NAME, user.screenName); assertEquals(EXPECTED_PROFILE_IMAGE_URL_HTTPS, user.profileImageUrlHttps); assertEquals(EXPECTED_VERIFIED, user.verified); assertNotNull(user.status); assertNotNull(user.withheldInCountries); assertEquals(1, user.withheldInCountries.size()); assertEquals(EXPECTED_WITHHELD_IN_COUNTRIES, user.withheldInCountries.get(0)); } finally { CommonUtils.closeQuietly(reader); } }