public static List<PostingTask> loadingStatistics(List<PostingTask> postingTasks, int userId) { if (postingTasks.size() > 0) { List<Profile> profiles = factory.create(ProfileService.class).getByUserId(userId); Vkontakte vk = new Vkontakte(SocialNetworkCredentialsUtils.getDefaultVkAppsIdAsApps()); for (Profile profile : profiles) { AccessToken accessToken = new AccessToken(); accessToken.setAccessToken(profile.getAccessToken()); accessToken.setUserId(profile.getVkId()); accessToken.setExpirationMoment(profile.getExtTime()); vk.setAccessToken(accessToken); try { return vk.execute().getPostStats(postingTasks); } catch (VKException e) { } } } return postingTasks; }